diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-01-08 00:56:48 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-01-08 00:56:48 +0000 |
commit | 649c7b069f53596e2c651d6524cf7c6621e3d565 (patch) | |
tree | 843dea1c8f456052afad31c30fa10dcf7f0eb6b1 /clang/test/SemaCXX/conversion-function.cpp | |
parent | 1c3996abc7201af3e2041527a3e1fb3d4d4774c1 (diff) | |
download | bcm5719-llvm-649c7b069f53596e2c651d6524cf7c6621e3d565.tar.gz bcm5719-llvm-649c7b069f53596e2c651d6524cf7c6621e3d565.zip |
PR18234: Mark a tag definition as invalid early if it appears in a
type-specifier in C++. Some checks will assert in this case otherwise (in
particular, the access specifier may be missing if this happens inside a class
definition, due to a violation of an AST invariant).
llvm-svn: 198721
Diffstat (limited to 'clang/test/SemaCXX/conversion-function.cpp')
-rw-r--r-- | clang/test/SemaCXX/conversion-function.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/conversion-function.cpp b/clang/test/SemaCXX/conversion-function.cpp index 7eaed54934b..0a35ea4ff59 100644 --- a/clang/test/SemaCXX/conversion-function.cpp +++ b/clang/test/SemaCXX/conversion-function.cpp @@ -405,3 +405,14 @@ namespace PR12712 { A f(const C c) { return c; } } + +namespace PR18234 { + struct A { + operator enum E { e } (); // expected-error {{'PR18234::A::E' can not be defined in a type specifier}} + operator struct S { int n; } (); // expected-error {{'PR18234::A::S' can not be defined in a type specifier}} + } a; + A::S s = a; + A::E e = a; // expected-note {{here}} + bool k1 = e == A::e; // expected-error {{no member named 'e'}} + bool k2 = e.n == 0; +} |