From 458ea76041ba41d61869543939274ebe296ac85a Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Wed, 16 Jul 2014 05:16:52 +0000 Subject: 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 --- clang/test/SemaCXX/enum-bitfield.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'clang/test/SemaCXX/enum-bitfield.cpp') 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; +}; +} -- cgit v1.2.3