diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2014-08-26 18:13:47 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-08-26 18:13:47 +0000 |
commit | 840438bb0676e4175c4e48e0de083700c8ae04c5 (patch) | |
tree | 48b32b1708982d28768f7e74d00f0f31350ebac7 /clang/lib/Sema/SemaDecl.cpp | |
parent | 5c4f4a6c339d9f20e3d359a805db7823f6ccaed8 (diff) | |
download | bcm5719-llvm-840438bb0676e4175c4e48e0de083700c8ae04c5.tar.gz bcm5719-llvm-840438bb0676e4175c4e48e0de083700c8ae04c5.zip |
c11- Check for c11 language option as documentation says
feature is c11 about nested struct declarations must have
struct-declarator-list. Without this change, code
which was meant for c99 breaks. rdar://18125536
llvm-svn: 216469
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 0079c4925ac..b6c09716199 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -3450,7 +3450,7 @@ Decl *Sema::ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS, // C11 6.7.2.1p2: // A struct-declaration that does not declare an anonymous structure or // anonymous union shall contain a struct-declarator-list. - if (!getLangOpts().CPlusPlus && CurContext->isRecord() && + if (getLangOpts().C11 && CurContext->isRecord() && DS.getStorageClassSpec() == DeclSpec::SCS_unspecified) { // Check for Microsoft C extension: anonymous struct/union member. // Handle 2 kinds of anonymous struct/union: |