aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Parse')
-rw-r--r--lib/Parse/DeclSpec.cpp2
-rw-r--r--lib/Parse/ParseDecl.cpp5
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/Parse/DeclSpec.cpp b/lib/Parse/DeclSpec.cpp
index 258dc87c44..4459c804f3 100644
--- a/lib/Parse/DeclSpec.cpp
+++ b/lib/Parse/DeclSpec.cpp
@@ -319,5 +319,5 @@ bool DeclSpec::isMissingDeclaratorOk() {
|| tst == TST_struct
|| tst == TST_class
|| tst == TST_enum
- ) && getTypeRep() != 0;
+ ) && getTypeRep() != 0 && StorageClassSpec != DeclSpec::SCS_typedef;
}
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 3ec1764612..8d4705a7bf 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -888,9 +888,10 @@ ParseStructDeclaration(DeclSpec &DS,
SourceLocation DSStart = Tok.getLocation();
ParseSpecifierQualifierList(DS);
- // If there are no declarators, issue a warning.
+ // If there are no declarators, this is a free-standing declaration
+ // specifier. Let the actions module cope with it.
if (Tok.is(tok::semi)) {
- Diag(DSStart, diag::w_no_declarators);
+ Actions.ParsedFreeStandingDeclSpec(CurScope, DS);
return;
}