diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2008-12-28 15:28:59 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2008-12-28 15:28:59 +0000 |
commit | a4ed0d8d75212dc01b4438829a4b0c846d99458d (patch) | |
tree | f72d8fcea1a6e4db4a415065d4e7d0eff5e96c96 /lib/Parse/DeclSpec.cpp | |
parent | 3c902ced87cd3e9994116485d7f28ca7f58b68e7 (diff) |
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
Diffstat (limited to 'lib/Parse/DeclSpec.cpp')
-rw-r--r-- | lib/Parse/DeclSpec.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Parse/DeclSpec.cpp b/lib/Parse/DeclSpec.cpp index b0ac36870c..258dc87c44 100644 --- a/lib/Parse/DeclSpec.cpp +++ b/lib/Parse/DeclSpec.cpp @@ -313,3 +313,11 @@ void DeclSpec::Finish(Diagnostic &D, SourceManager& SrcMgr, // '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; +} |