[clang] c348fb1 - Revert "[Concepts] Add missing CXXThisScope to function template constraint substitution"
Saar Raz via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 4 14:58:31 PST 2020
Author: Saar Raz
Date: 2020-02-05T00:58:02+02:00
New Revision: c348fb1786ba62a69ec0ee9e9ed4a77fc46e071f
URL: https://github.com/llvm/llvm-project/commit/c348fb1786ba62a69ec0ee9e9ed4a77fc46e071f
DIFF: https://github.com/llvm/llvm-project/commit/c348fb1786ba62a69ec0ee9e9ed4a77fc46e071f.diff
LOG: Revert "[Concepts] Add missing CXXThisScope to function template constraint substitution"
This reverts commit 0c67cfdb114b4c2f5c7ec374cf12118c7fa9d768 which has a broken test.
Added:
Modified:
clang/lib/Sema/SemaConcept.cpp
clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
clang/test/SemaTemplate/instantiate-requires-clause.cpp
Removed:
################################################################################
diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp
index 290e4cbff4fd..39169664dad5 100755
--- a/clang/lib/Sema/SemaConcept.cpp
+++ b/clang/lib/Sema/SemaConcept.cpp
@@ -329,13 +329,6 @@ bool Sema::CheckFunctionConstraints(const FunctionDecl *FD,
Satisfaction.IsSatisfied = true;
return false;
}
- Qualifiers ThisQuals;
- CXXRecordDecl *Record = nullptr;
- if (auto *Method = dyn_cast<CXXMethodDecl>(FD)) {
- ThisQuals = Method->getMethodQualifiers();
- Record = const_cast<CXXRecordDecl *>(Method->getParent());
- }
- CXXThisScopeRAII ThisScope(*this, Record, ThisQuals, Record != nullptr);
// We substitute with empty arguments in order to rebuild the atomic
// constraint in a constant-evaluated context.
// FIXME: Should this be a dedicated TreeTransform?
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 7094462e74c9..0e1d5fa77c69 100755
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -4271,13 +4271,7 @@ bool Sema::CheckInstantiatedFunctionTemplateConstraints(
Scope, MLTAL))
return true;
}
- Qualifiers ThisQuals;
- CXXRecordDecl *Record = nullptr;
- if (auto *Method = dyn_cast<CXXMethodDecl>(Decl)) {
- ThisQuals = Method->getMethodQualifiers();
- Record = Method->getParent();
- }
- CXXThisScopeRAII ThisScope(*this, Record, ThisQuals, Record != nullptr);
+
return CheckConstraintSatisfaction(Template, TemplateAC, TemplateArgs,
PointOfInstantiation, Satisfaction);
}
diff --git a/clang/test/SemaTemplate/instantiate-requires-clause.cpp b/clang/test/SemaTemplate/instantiate-requires-clause.cpp
index 2a42e2410fc3..8e9d5bffa906 100644
--- a/clang/test/SemaTemplate/instantiate-requires-clause.cpp
+++ b/clang/test/SemaTemplate/instantiate-requires-clause.cpp
@@ -57,13 +57,4 @@ struct S3 {
static constexpr void f(Args...) { }
};
-static_assert((S3<int>::f(), true));
-
-template<typename T>
-struct S4 {
- template<typename>
- void foo() requires (*this, true) { }
- void goo() requires (*this, true) { }
-};
-
-static_assert((S4<int>{}.foo<int>(), S4<int>{}.goo(), true));
+static_assert((S3<int>::f(), true));
\ No newline at end of file
More information about the cfe-commits
mailing list