[PATCH] D23492: Make function local tags visible.
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 17 14:17:13 PDT 2016
rsmith added inline comments.
================
Comment at: lib/Sema/SemaTemplateInstantiateDecl.cpp:3597-3599
@@ -3595,4 +3596,5 @@
// FIXME: Check that the definition is visible before trying to instantiate
// it. This requires us to track the instantiation stack in order to know
// which definitions should be visible.
+ if (DiagnoseUninstantiableTemplate(PointOfInstantiation, Function,
----------------
Please update this FIXME to just "We need to track the instantiation stack in order to know which definitions should be visible within this instantiation."
================
Comment at: lib/Sema/SemaTemplateInstantiateDecl.cpp:3600-3605
@@ -3598,2 +3599,8 @@
// which definitions should be visible.
+ if (DiagnoseUninstantiableTemplate(PointOfInstantiation, Function,
+ Function->getInstantiatedFromMemberFunction(),
+ PatternDecl,
+ const_cast<FunctionDecl*>(PatternDecl),
+ TSK, /*Complain*/DefinitionRequired))
+ return;
----------------
I think this should be checked before we deal with late-parsed templates -- if the template definition isn't visible, an attempt to instantiate it shouldn't trigger it being parsed.
https://reviews.llvm.org/D23492
More information about the cfe-commits
mailing list