diff options
Diffstat (limited to 'test/SemaCXX/complex-overload.cpp')
| -rw-r--r-- | test/SemaCXX/complex-overload.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/SemaCXX/complex-overload.cpp b/test/SemaCXX/complex-overload.cpp index 1381968751af..9373e44de950 100644 --- a/test/SemaCXX/complex-overload.cpp +++ b/test/SemaCXX/complex-overload.cpp @@ -4,9 +4,10 @@ char *foo(float); void test_foo_1(float fv, double dv, float _Complex fc, double _Complex dc) { char *cp1 = foo(fv); char *cp2 = foo(dv); - // Note: GCC and EDG reject these two, but they are valid C99 conversions - char *cp3 = foo(fc); - char *cp4 = foo(dc); + // Note: GCC and EDG reject these two, they are valid C99 conversions but + // shouldn't be accepted in C++ because the result is surprising. + char *cp3 = foo(fc); // expected-error {{implicit conversion from '_Complex float' to 'float' is not permitted in C++}} + char *cp4 = foo(dc); // expected-error {{implicit conversion from '_Complex double' to 'float' is not permitted in C++}} } int *foo(float _Complex); |
