summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/enum-bitfield.cpp
diff options
context:
space:
mode:
authorSerge Pavlov <sepavloff@gmail.com>2014-07-16 05:16:52 +0000
committerSerge Pavlov <sepavloff@gmail.com>2014-07-16 05:16:52 +0000
commit458ea76041ba41d61869543939274ebe296ac85a (patch)
tree5b19ed6faa88e6037a159ded2985a608cf3da919 /clang/test/SemaCXX/enum-bitfield.cpp
parentc68237bc2c7283f9cc62593b3dd8e30562014400 (diff)
downloadbcm5719-llvm-458ea76041ba41d61869543939274ebe296ac85a.tar.gz
bcm5719-llvm-458ea76041ba41d61869543939274ebe296ac85a.zip
Improve error recovery around colon.
Recognize additional cases, when '::' is mistyped as ':'. This is a fix to RP18587 - colons have too much protection in member-declarations Review is tracked by http://reviews.llvm.org/D3653. This is an attempt to recommit the fix, initially committed as r212957 but then reverted in r212965 as it broke self-build. In the updated patch ParseDirectDeclarator turns on colon protection in for context as well. llvm-svn: 213120
Diffstat (limited to 'clang/test/SemaCXX/enum-bitfield.cpp')
-rw-r--r--clang/test/SemaCXX/enum-bitfield.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/enum-bitfield.cpp b/clang/test/SemaCXX/enum-bitfield.cpp
index 63445ca0583..ec849b79a74 100644
--- a/clang/test/SemaCXX/enum-bitfield.cpp
+++ b/clang/test/SemaCXX/enum-bitfield.cpp
@@ -16,3 +16,15 @@ struct Y {
enum E : int(2);
enum E : Z(); // expected-error{{integral constant expression must have integral or unscoped enumeration type, not 'Z'}}
};
+
+namespace pr18587 {
+struct A {
+ enum class B {
+ C
+ };
+};
+const int C = 4;
+struct D {
+ A::B : C;
+};
+}
OpenPOWER on IntegriCloud