aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2025-03-10 10:18:56 +0100
committerNikita Popov <npopov@redhat.com>2025-03-10 10:32:08 +0100
commit07f3388fff0c73c1119d06ca1c2353fd012361c0 (patch)
treef750a1d6664b370228a0c783ad770a06ded8abcd /clang/lib/Sema/SemaLookup.cpp
parentc579ec66c77461122d93deadebc318fbb846b830 (diff)
downloadllvm-07f3388fff0c73c1119d06ca1c2353fd012361c0.zip
llvm-07f3388fff0c73c1119d06ca1c2353fd012361c0.tar.gz
llvm-07f3388fff0c73c1119d06ca1c2353fd012361c0.tar.bz2
Revert "[clang] Implement instantiation context note for checking template parameters (#126088)"
This reverts commit a24523ac8dc07f3478311a5969184b922b520395. This is causing significant compile-time regressions for C++ code, see: https://github.com/llvm/llvm-project/pull/126088#issuecomment-2704874202
Diffstat (limited to 'clang/lib/Sema/SemaLookup.cpp')
-rw-r--r--clang/lib/Sema/SemaLookup.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp
index f3af5145..aecf8ed 100644
--- a/clang/lib/Sema/SemaLookup.cpp
+++ b/clang/lib/Sema/SemaLookup.cpp
@@ -1580,13 +1580,9 @@ llvm::DenseSet<Module*> &Sema::getLookupModules() {
unsigned N = CodeSynthesisContexts.size();
for (unsigned I = CodeSynthesisContextLookupModules.size();
I != N; ++I) {
- auto &Ctx = CodeSynthesisContexts[I];
- // FIXME: Are there any other context kinds that shouldn't be looked at
- // here?
- if (Ctx.Kind == CodeSynthesisContext::PartialOrderingTTP ||
- Ctx.Kind == CodeSynthesisContext::CheckTemplateParameter)
- continue;
- Module *M = Ctx.Entity ? getDefiningModule(*this, Ctx.Entity) : nullptr;
+ Module *M = CodeSynthesisContexts[I].Entity ?
+ getDefiningModule(*this, CodeSynthesisContexts[I].Entity) :
+ nullptr;
if (M && !LookupModulesCache.insert(M).second)
M = nullptr;
CodeSynthesisContextLookupModules.push_back(M);
@@ -3707,8 +3703,7 @@ Sema::LookupLiteralOperator(Scope *S, LookupResult &R,
TemplateParameterList *Params = FD->getTemplateParameters();
if (Params->size() == 1) {
IsTemplate = true;
- NamedDecl *Param = Params->getParam(0);
- if (!Param->isTemplateParameterPack() && !StringLit) {
+ if (!Params->getParam(0)->isTemplateParameterPack() && !StringLit) {
// Implied but not stated: user-defined integer and floating literals
// only ever use numeric literal operator templates, not templates
// taking a parameter of class type.
@@ -3721,7 +3716,6 @@ Sema::LookupLiteralOperator(Scope *S, LookupResult &R,
if (StringLit) {
SFINAETrap Trap(*this);
CheckTemplateArgumentInfo CTAI;
- CheckTemplateParameterRAII CTP(*this, Param);
TemplateArgumentLoc Arg(TemplateArgument(StringLit), StringLit);
if (CheckTemplateArgument(
Params->getParam(0), Arg, FD, R.getNameLoc(), R.getNameLoc(),