r216490 - Clarify comment so this doesn't appear to be a C11-only rule.
Richard Smith
richard-llvm at metafoo.co.uk
Tue Aug 26 14:51:57 PDT 2014
Author: rsmith
Date: Tue Aug 26 16:51:57 2014
New Revision: 216490
URL: http://llvm.org/viewvc/llvm-project?rev=216490&view=rev
Log:
Clarify comment so this doesn't appear to be a C11-only rule.
Modified:
cfe/trunk/lib/Sema/SemaDecl.cpp
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=216490&r1=216489&r2=216490&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Tue Aug 26 16:51:57 2014
@@ -3450,6 +3450,9 @@ Decl *Sema::ParsedFreeStandingDeclSpec(S
// 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.
More information about the cfe-commits
mailing list