[PATCH] D145034: [Clang][Sema] Start fixing handling of out-of-line definitions of constrained templates

Alexander Shaposhnikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 9 06:36:22 PST 2023


alexander-shaposhnikov added inline comments.


================
Comment at: clang/lib/Sema/SemaCXXScopeSpec.cpp:141
+              ClassTemplate->getInjectedClassNameSpecialization();
+          if (Context.hasSameType(Injected, ContextType))
+            return ClassTemplate->getTemplatedDecl();
----------------
rsmith wrote:
> This should also be guarded by a check that `TemplateParameterListsAreEqual` between `ClassTemplate->getTemplateParameters()` and the template parameter list we picked out of the given array of template parameter lists.
> 
> (With that check in place, we can move this back before the search for partial specializations.)
The problem is that currently the template parameter list (the one which we are supposed to pick above) is not always present,
thus the fallback and this check are both still necessary. It happens e.g. for invalid code and if i remove the fallback it triggers more changes to the diagnostic output, other than that there might be more cases where we currently don't set TemplateParamLists for CXXScopeSpec, i kinda wanted to move incrementally.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145034/new/

https://reviews.llvm.org/D145034



More information about the cfe-commits mailing list