[PATCH] D19327: Keep invalid function body as part of the AST
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 26 17:32:51 PDT 2016
rsmith added inline comments.
================
Comment at: lib/Sema/SemaDecl.cpp:5044-5045
@@ -5043,4 +5043,4 @@
// function template specialization, add it to the scope stack.
- if (New->getDeclName() && AddToScope &&
- !(D.isRedeclaration() && New->isInvalidDecl())) {
+ if (New->getDeclName() && AddToScope && !(D.isRedeclaration()
+ && New->isInvalidDecl() && !D.isFunctionDefinition())) {
// Only make a locally-scoped extern declaration visible if it is the first
----------------
Can we delete the invalid-decl check entirely here? If it's doing something important, we need to figure out what and make sure we preserve that intent if it's important, but either way it doesn't make a lot of sense to me for this to depend on whether the declaration has a definition.
http://reviews.llvm.org/D19327
More information about the cfe-commits
mailing list