summaryrefslogtreecommitdiff
path: root/lib/Parse/ParseStmt.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-08-01 16:39:29 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-08-01 16:39:29 +0000
commitccbfd6c29661bacd81758db6527191bb7efa2c90 (patch)
tree6cf66823dbd3c3f784bab8c7a3b5a45088aa0911 /lib/Parse/ParseStmt.cpp
parenta70f96e037411959d26711a7648342e6f9700afb (diff)
downloadclang-ccbfd6c29661bacd81758db6527191bb7efa2c90.tar.gz
[Parse] Let declarations follow labels in -fms-extensions mode
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
Diffstat (limited to 'lib/Parse/ParseStmt.cpp')
-rw-r--r--lib/Parse/ParseStmt.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp
index 9043ebb9a2..d0557b8a62 100644
--- a/lib/Parse/ParseStmt.cpp
+++ b/lib/Parse/ParseStmt.cpp
@@ -206,7 +206,8 @@ Retry:
}
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,