diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-03-11 20:22:50 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-03-11 20:22:50 +0000 |
commit | 2d2e9cfdc1dbb6e4a22f8c0b1abcd30437e3795d (patch) | |
tree | 59a627bb27a9c540e557524e0dc81e0d37b735c5 /lib/Sema/SemaDecl.cpp | |
parent | ceb77d909f80d4949ee6177094510413c391cddc (diff) |
Eliminate CXXClassVarDecl. It doesn't add anything
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66696 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 8c82c5cad3..f77d1d8845 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -1580,27 +1580,20 @@ Sema::ActOnVariableDeclarator(Scope* S, Declarator& D, DeclContext* DC, return 0; } - if (DC->isRecord()) { - // This is a static data member for a C++ class. - NewVD = CXXClassVarDecl::Create(Context, cast<CXXRecordDecl>(DC), - D.getIdentifierLoc(), II, - R); - } else { - bool ThreadSpecified = D.getDeclSpec().isThreadSpecified(); - if (S->getFnParent() == 0) { - // C99 6.9p2: The storage-class specifiers auto and register shall not - // appear in the declaration specifiers in an external declaration. - if (SC == VarDecl::Auto || SC == VarDecl::Register) { - Diag(D.getIdentifierLoc(), diag::err_typecheck_sclass_fscope); - InvalidDecl = true; - } + bool ThreadSpecified = D.getDeclSpec().isThreadSpecified(); + if (!DC->isRecord() && S->getFnParent() == 0) { + // C99 6.9p2: The storage-class specifiers auto and register shall not + // appear in the declaration specifiers in an external declaration. + if (SC == VarDecl::Auto || SC == VarDecl::Register) { + Diag(D.getIdentifierLoc(), diag::err_typecheck_sclass_fscope); + InvalidDecl = true; } - NewVD = VarDecl::Create(Context, DC, D.getIdentifierLoc(), - II, R, SC, - // FIXME: Move to DeclGroup... - D.getDeclSpec().getSourceRange().getBegin()); - NewVD->setThreadSpecified(ThreadSpecified); } + NewVD = VarDecl::Create(Context, DC, D.getIdentifierLoc(), + II, R, SC, + // FIXME: Move to DeclGroup... + D.getDeclSpec().getSourceRange().getBegin()); + NewVD->setThreadSpecified(ThreadSpecified); NewVD->setNextDeclarator(LastDeclarator); // Handle attributes prior to checking for duplicates in MergeVarDecl |