]> granicus.if.org Git - clang/commitdiff
Be careful; even though we had a proper name at the beginning of
authorDouglas Gregor <dgregor@apple.com>
Sat, 24 Jul 2010 00:10:38 +0000 (00:10 +0000)
committerDouglas Gregor <dgregor@apple.com>
Sat, 24 Jul 2010 00:10:38 +0000 (00:10 +0000)
Sema::ActOnDeclarator doesn't mean that the Decl we ended up creating
has a useful name. <rdar://problem/8229910>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109296 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp

index cf5f98e0685b4dddcfd0a7f8099aa61c32e54031..7360805f60f6f12746d3248ffe4910ada4e1ceed 100644 (file)
@@ -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);