aboutsummaryrefslogtreecommitdiff
path: root/clang/test/SemaTemplate/concepts-out-of-line-def.cpp
diff options
context:
space:
mode:
authorErich Keane <erich.keane@intel.com>2023-05-18 09:05:51 -0700
committerErich Keane <erich.keane@intel.com>2023-05-18 09:07:42 -0700
commitfbd8f8985e36581487371e9ff4ac7d99655b51e7 (patch)
tree502d763aea716dcd4a1e356362720876d5431f3e /clang/test/SemaTemplate/concepts-out-of-line-def.cpp
parent153d9b9371c3adf719cad4307e395692caa752ac (diff)
downloadllvm-fbd8f8985e36581487371e9ff4ac7d99655b51e7.zip
llvm-fbd8f8985e36581487371e9ff4ac7d99655b51e7.tar.gz
llvm-fbd8f8985e36581487371e9ff4ac7d99655b51e7.tar.bz2
Ensure comparison of constraints creates a code synth context
This is a regression from 6db007a0 that was reported in: https://github.com/llvm/llvm-project/issues/62697 The assertion was because we require a code synthesis context for the instantiation of templates, and this reproducer causes a comparison that doesn't have a parent-template causing one to exists. This patch fixes it by creating a ConstraintNormalization context.
Diffstat (limited to 'clang/test/SemaTemplate/concepts-out-of-line-def.cpp')
-rw-r--r--clang/test/SemaTemplate/concepts-out-of-line-def.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/concepts-out-of-line-def.cpp b/clang/test/SemaTemplate/concepts-out-of-line-def.cpp
index b7c91712..25b34f0 100644
--- a/clang/test/SemaTemplate/concepts-out-of-line-def.cpp
+++ b/clang/test/SemaTemplate/concepts-out-of-line-def.cpp
@@ -399,3 +399,16 @@ inline void W0<T7, 0>::W1<T8>::f(const T9 &) {}
} // namespace three_level
} // namespace MultilevelTemplateWithPartialSpecialization
+
+namespace PR62697 {
+template<typename>
+concept c = true;
+
+template<typename T>
+struct s {
+ void f() requires c<void(T)>;
+};
+
+template<typename T>
+void s<T>::f() requires c<void(T)> { }
+}