Diagnose declarations that don't declare anything, and fix PR3020.
Examples:
int;
typedef int;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61454 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/DeclSpec.cpp b/lib/Parse/DeclSpec.cpp
index b0ac368..258dc87 100644
--- a/lib/Parse/DeclSpec.cpp
+++ b/lib/Parse/DeclSpec.cpp
@@ -313,3 +313,11 @@
// 'data definition has no type or storage class'?
}
+bool DeclSpec::isMissingDeclaratorOk() {
+ TST tst = getTypeSpecType();
+ return (tst == TST_union
+ || tst == TST_struct
+ || tst == TST_class
+ || tst == TST_enum
+ ) && getTypeRep() != 0;
+}