summaryrefslogtreecommitdiffstats
path: root/clang/test/PCH/cxx2a-concept-specialization-expr.cpp
diff options
context:
space:
mode:
authorSaar Raz <saar@raz.email>2019-10-15 15:24:26 +0000
committerSaar Raz <saar@raz.email>2019-10-15 15:24:26 +0000
commit5d98ba6077dac656fbf023e9312d9c131d53144c (patch)
tree99153ade097830f469e5ff0a04fc37daeff3819a /clang/test/PCH/cxx2a-concept-specialization-expr.cpp
parentd545c9056e00988d2d146f8f1440b2dd192f306b (diff)
downloadbcm5719-llvm-5d98ba6077dac656fbf023e9312d9c131d53144c.tar.gz
bcm5719-llvm-5d98ba6077dac656fbf023e9312d9c131d53144c.zip
[Concepts] Concept Specialization Expressions
Part of C++20 Concepts implementation effort. Added Concept Specialization Expressions that are created when a concept is refe$ D41217 on Phabricator. (recommit after fixing failing Parser test on windows) llvm-svn: 374903
Diffstat (limited to 'clang/test/PCH/cxx2a-concept-specialization-expr.cpp')
-rw-r--r--clang/test/PCH/cxx2a-concept-specialization-expr.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/clang/test/PCH/cxx2a-concept-specialization-expr.cpp b/clang/test/PCH/cxx2a-concept-specialization-expr.cpp
new file mode 100644
index 00000000000..6227d57c872
--- /dev/null
+++ b/clang/test/PCH/cxx2a-concept-specialization-expr.cpp
@@ -0,0 +1,32 @@
+// RUN: %clang_cc1 -std=c++2a -emit-pch %s -o %t
+// RUN: %clang_cc1 -std=c++2a -include-pch %t -verify %s
+
+// expected-no-diagnostics
+
+#ifndef HEADER
+#define HEADER
+
+template<typename... T>
+concept C = true;
+
+namespace n {
+ template<typename... T>
+ concept C = true;
+}
+
+void f() {
+ (void)C<int>;
+ (void)C<int, void>;
+ (void)n::C<void>;
+}
+
+#else /*included pch*/
+
+int main() {
+ (void)C<int>;
+ (void)C<int, void>;
+ (void)n::C<void>;
+ f();
+}
+
+#endif // HEADER
OpenPOWER on IntegriCloud