diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:11:37 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:11:37 +0000 |
| commit | 461a67fa15370a9ec88f8f8a240bf7c123bb2029 (patch) | |
| tree | 6942083d7d56bba40ec790a453ca58ad3baf6832 /test/SemaCXX/complex-overload.cpp | |
| parent | 75c3240472ba6ac2669ee72ca67eb72d4e2851fc (diff) | |
Notes
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); |
