diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-06-28 03:01:12 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-06-28 03:01:12 +0000 |
commit | 8ea7e5838bb783ee208d20a030e8ce76dfe751e2 (patch) | |
tree | 89b53cf7b4e30264647805e7b9f2aa7f921fd0ca /clang/lib/Sema/SemaDeclCXX.cpp | |
parent | 31daf43c2b13dd3a8725d45add20f9fa0e2e635d (diff) | |
download | bcm5719-llvm-8ea7e5838bb783ee208d20a030e8ce76dfe751e2.tar.gz bcm5719-llvm-8ea7e5838bb783ee208d20a030e8ce76dfe751e2.zip |
Remove the call to GetTypeForDeclarator in Sema::ActOnCXXConditionDeclaration.
No functionality change.
llvm-svn: 133984
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 07eb9fe572a..c0d34da9221 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -8913,25 +8913,13 @@ DeclResult Sema::ActOnCXXConditionDeclaration(Scope *S, Declarator &D) { // new class or enumeration. assert(D.getDeclSpec().getStorageClassSpec() != DeclSpec::SCS_typedef && "Parser allowed 'typedef' as storage class of condition decl."); - - TagDecl *OwnedTag = 0; - TypeSourceInfo *TInfo = GetTypeForDeclarator(D, S, &OwnedTag); - QualType Ty = TInfo->getType(); - - if (Ty->isFunctionType()) { // The declarator shall not specify a function... - // We exit without creating a CXXConditionDeclExpr because a FunctionDecl - // would be created and CXXConditionDeclExpr wants a VarDecl. - Diag(D.getIdentifierLoc(), diag::err_invalid_use_of_function_type) + + Decl *Dcl = ActOnDeclarator(S, D); + if (isa<FunctionDecl>(Dcl)) { // The declarator shall not specify a function. + Diag(Dcl->getLocation(), diag::err_invalid_use_of_function_type) << D.getSourceRange(); return DeclResult(); - } else if (OwnedTag && OwnedTag->isDefinition()) { - // The type-specifier-seq shall not declare a new class or enumeration. - Diag(OwnedTag->getLocation(), diag::err_type_defined_in_condition); } - - Decl *Dcl = ActOnDeclarator(S, D); - if (!Dcl) - return DeclResult(); return Dcl; } |