diff options
Diffstat (limited to 'test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p6.cpp')
-rw-r--r-- | test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p6.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p6.cpp b/test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p6.cpp new file mode 100644 index 0000000000..f8a1bb72e3 --- /dev/null +++ b/test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p6.cpp @@ -0,0 +1,25 @@ +// RUN: %clang_cc1 -std=c++14 -fconcepts-ts -x c++ -verify %s + +template<typename T> +concept bool vc { true }; + +template<typename T> +struct B { typedef bool Boolean; }; + +template<int N> +B<void>::Boolean concept vctb(!0); + +template<typename T> +concept const bool vctc { true }; // expected-error {{declared type of variable concept must be 'bool'}} + +template<typename T> +concept int vcti { 5 }; // expected-error {{declared type of variable concept must be 'bool'}} + +template<typename T> +concept float vctf { 5.5 }; // expected-error {{declared type of variable concept must be 'bool'}} + +template<typename T> +concept auto vcta { true }; // expected-error {{declared type of variable concept must be 'bool'}} + +template<typename T> +concept decltype(auto) vctd { true }; // expected-error {{declared type of variable concept must be 'bool'}} |