diff options
author | Nathan Wilson <nwilson20@gmail.com> | 2016-01-29 04:43:59 +0000 |
---|---|---|
committer | Nathan Wilson <nwilson20@gmail.com> | 2016-01-29 04:43:59 +0000 |
commit | cf8ba0fbdb0e9da1162b1aa2600439ba48e50534 (patch) | |
tree | 485c89916ef8f5bc2c4facc643edcc0a6f584ac2 /test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p6.cpp | |
parent | b27326b345f28f2f35baf484f7970cad4750070f (diff) | |
download | clang-cf8ba0fbdb0e9da1162b1aa2600439ba48e50534.tar.gz |
[Concepts] Implement a portion of Concepts TS[dcl.spec.concept]p5 and p6:
Diagnose if the return type of a function concept or declaration type of a
variable concept is not bool.
Reviewers: hubert.reinterpretcast
Differential Revision: http://reviews.llvm.org/D16163
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259159 91177308-0d34-0410-b5e6-96231b3b80d8
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'}} |