summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-03-23 23:09:08 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-03-23 23:09:08 +0000
commit3343fad1f1ec81af43674b76eddbe9ab10e344eb (patch)
tree023a7b07425bdaf35e68ff80d75c6205c74dbfb6 /test/SemaCXX
parentad8d8a31b010ceac4cad2553f16fc1a77c4b2e5e (diff)
When defining a forward-declared enum, don't try to attach the definition to
a previous declaration if the redeclaration is invalid. That way lies madness. Fixes a crash-on-invalid reported by Abramo. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153349 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX')
-rw-r--r--test/SemaCXX/enum-scoped.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/SemaCXX/enum-scoped.cpp b/test/SemaCXX/enum-scoped.cpp
index 31190bebaa..44394296e3 100644
--- a/test/SemaCXX/enum-scoped.cpp
+++ b/test/SemaCXX/enum-scoped.cpp
@@ -189,3 +189,14 @@ namespace test7 {
enum class E { e = (struct S*)0 == (struct S*)0 };
S *p;
}
+
+namespace test8 {
+ template<typename T> struct S {
+ enum A : int; // expected-note {{here}}
+ enum class B; // expected-note {{here}}
+ enum class C : int; // expected-note {{here}}
+ };
+ template<typename T> enum S<T>::A { a }; // expected-error {{previously declared with fixed underlying type}}
+ template<typename T> enum class S<T>::B : char { b }; // expected-error {{redeclared with different underlying}}
+ template<typename T> enum S<T>::C : int { c }; // expected-error {{previously declared as scoped}}
+}