[PATCH] D41284: [Concepts] Associated constraints infrastructure.

Saar Raz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 18 02:30:39 PDT 2018


saar.raz added inline comments.


================
Comment at: test/CXX/concepts-ts/temp/temp.constr/temp.constr.decl/var-template-decl.cpp:10
+
+template <typename U> requires bool(U())
+int B::A = int(U());
----------------
Quuxplusone wrote:
> For my own edification, could you explain whether, given
> 
>     #define BOOL bool
>     using typedef_for_bool = bool;
> 
> you'd expect to diagnose a redeclaration of `B::A` with associated constraint
> 
>     requires bool( U() )  // extra whitespace
> 
> or
> 
>     requires BOOL(U())  // different spelling of `bool`
> 
> or
> 
>     requires typedef_for_bool(U())  // different spelling of `bool`
> 
> ? My naive reading of N4762 temp.constr.atomic/2 says that none of these constraints (on line 10) would be "identical" to the constraint on line 6... but then I don't understand what's the salient difference between line 10 (which apparently gives no error) and line 22 (which apparently gives an error).
Line 22 has a not (!) operator in front of the bool(), I guess you missed that? 


Repository:
  rC Clang

https://reviews.llvm.org/D41284





More information about the cfe-commits mailing list