From 212cab3f64363b5ffbb932e43b98e54e1e79f26c Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 11 Mar 2009 20:22:50 +0000 Subject: Eliminate CXXClassVarDecl. It doesn't add anything llvm-svn: 66696 --- clang/lib/Sema/SemaDecl.cpp | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'clang/lib/Sema/SemaDecl.cpp') diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 8c82c5cad33..f77d1d8845f 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/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(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 -- cgit v1.2.3