[PATCH] D16163: [Concepts] Diagnose when return type of a function concept or declaration type of a variable concept is not bool.

Hubert Tong via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 13 17:15:18 PST 2016


hubert.reinterpretcast added a comment.

Please add tests for `const bool` for both the function and variable cases (should get the error).


================
Comment at: test/CXX/concepts-ts/dcl.dcl/dcl.spec/dcl.spec.concept/p5.cpp:22
@@ +21,3 @@
+template<typename T>
+concept auto fcrta(void) -> bool { return true; } // expected-error {{declared return type of function concept must be 'bool'}}
+
----------------
The declared return type here //is// `bool` (N4567 subclause 7.1.6.4 [dcl.spec.auto] paragraph 2).

================
Comment at: test/Parser/cxx-concept-declaration.cpp:17
@@ -16,3 @@
-template<typename T, int = 0>
-concept auto C4(void) -> bool { return true; }
-
----------------
This is valid.


http://reviews.llvm.org/D16163





More information about the cfe-commits mailing list