From: Douglas Gregor Date: Sat, 24 Jul 2010 00:10:38 +0000 (+0000) Subject: Be careful; even though we had a proper name at the beginning of X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f178dcab504ac47901dc99ff51b0d0fe07dddbe1;p=clang Be careful; even though we had a proper name at the beginning of Sema::ActOnDeclarator doesn't mean that the Decl we ended up creating has a useful name. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109296 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index cf5f98e068..7360805f60 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -2245,7 +2245,7 @@ Sema::HandleDeclarator(Scope *S, Declarator &D, // If this has an identifier and is not an invalid redeclaration or // function template specialization, add it to the scope stack. - if (Name && !(Redeclaration && New->isInvalidDecl())) + if (New->getDeclName() && !(Redeclaration && New->isInvalidDecl())) PushOnScopeChains(New, S); return DeclPtrTy::make(New);