summaryrefslogtreecommitdiff
path: root/clang/test/AST/ByteCode/cxx2a.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/AST/ByteCode/cxx2a.cpp')
-rw-r--r--clang/test/AST/ByteCode/cxx2a.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/AST/ByteCode/cxx2a.cpp b/clang/test/AST/ByteCode/cxx2a.cpp
index 744c99eaa1e6..533173d84792 100644
--- a/clang/test/AST/ByteCode/cxx2a.cpp
+++ b/clang/test/AST/ByteCode/cxx2a.cpp
@@ -239,3 +239,17 @@ namespace GH150705 {
constexpr const A& a = b;
constexpr auto x = (a.*q)(); // both-error {{constant expression}}
}
+
+namespace DependentRequiresExpr {
+ template <class T,
+ bool = []() -> bool { // both-error {{not a constant expression}}
+ if (requires { T::type; })
+ return true;
+ return false;
+ }()>
+ struct p {
+ using type = void;
+ };
+
+ template <class T> using P = p<T>::type; // both-note {{while checking a default template argument}}
+}