summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/enum-scoped.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
committerdim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
commit952eddef9aff85b1e92626e89baaf7a360e2ac85 (patch)
treedf8df0b0067b381eab470a3b8f28d14a552a6340 /test/SemaCXX/enum-scoped.cpp
parentea266cad53e3d49771fa38103913d3ec7a166694 (diff)
downloadFreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.zip
FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.tar.gz
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841
Diffstat (limited to 'test/SemaCXX/enum-scoped.cpp')
-rw-r--r--test/SemaCXX/enum-scoped.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/SemaCXX/enum-scoped.cpp b/test/SemaCXX/enum-scoped.cpp
index d01000d..b4aad18b 100644
--- a/test/SemaCXX/enum-scoped.cpp
+++ b/test/SemaCXX/enum-scoped.cpp
@@ -266,3 +266,33 @@ namespace PR15633 {
struct B { enum class E; };
template<typename T> enum class B::E { e }; // expected-error {{enumeration cannot be a template}}
}
+
+namespace PR16900 {
+ enum class A;
+ A f(A a) { return -a; } // expected-error {{invalid argument type 'PR16900::A' to unary expression}}
+}
+
+namespace rdar15124329 {
+ enum class B : bool { F, T };
+
+ const rdar15124329::B T1 = B::T;
+ typedef B C; const C T2 = B::T;
+
+ static_assert(T1 != B::F, "");
+ static_assert(T2 == B::T, "");
+}
+
+namespace PR18044 {
+ enum class E { a };
+
+ int E::e = 0; // expected-error {{does not refer into a class}}
+ void E::f() {} // expected-error {{does not refer into a class}}
+ struct E::S {}; // expected-error {{no struct named 'S'}}
+ struct T : E::S {}; // expected-error {{expected class name}}
+ enum E::E {}; // expected-error {{no enum named 'E'}}
+ int E::*p; // expected-error {{does not point into a class}}
+ using E::f; // expected-error {{no member named 'f'}}
+
+ using E::a; // ok!
+ E b = a;
+}
OpenPOWER on IntegriCloud