]> granicus.if.org Git - clang/commitdiff
Clarify comment so this doesn't appear to be a C11-only rule.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 26 Aug 2014 21:51:57 +0000 (21:51 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 26 Aug 2014 21:51:57 +0000 (21:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216490 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp

index 0079c4925ac1c1a55946dd9432d92221590a43b9..e5cf31a9b3734b5bae5a5a476d0cec1efe0bdd58 100644 (file)
@@ -3450,6 +3450,9 @@ 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.
+  //
+  // This rule also existed in C89 and C99; the grammar for struct-declaration
+  // did not permit a struct-declaration without a struct-declarator-list.
   if (!getLangOpts().CPlusPlus && CurContext->isRecord() &&
       DS.getStorageClassSpec() == DeclSpec::SCS_unspecified) {
     // Check for Microsoft C extension: anonymous struct/union member.