MSVC permits declarations in these places as conforming extension (it is
a constraint violation otherwise).
This fixes PR28782.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277352
91177308-0d34-0410-b5e6-
96231b3b80d8
}
default: {
- if ((getLangOpts().CPlusPlus || Allowed == ACK_Any) &&
+ if ((getLangOpts().CPlusPlus || getLangOpts().MicrosoftExt ||
+ Allowed == ACK_Any) &&
isDeclarationStatement()) {
SourceLocation DeclStart = Tok.getLocation(), DeclEnd;
DeclGroupPtrTy Decl = ParseDeclaration(Declarator::BlockContext,
_Static_assert(__alignof(struct align_before_key1) == 16, "");
_Static_assert(__alignof(struct align_before_key2) == 16, "");
_Static_assert(__alignof(struct align_before_key3) == 16, "");
+
+void PR28782(int i) {
+foo:
+ int n;
+ switch (i) {
+ case 0:
+ int m;
+ }
+}