This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [c++-concepts] requires expression semantics

On 07/01/2013 01:27 PM, Andrew Sutton wrote:
Unfortunately, the behavior differs from the test suite for
std::is_convertible. In particular, this fails:

 static_assert(__is_convertible_to(int(int), int(&)(int)), "");

whereas this succeeds )

 static_assert(is_convertible<int(int), int(&)(int)>::value, "");

Hmm, that probably has to do with reference decay; we don't handle conversion from reference type everywhere because there are no expressions of reference type. So perhaps in the case of REFERENCE_TYPE can_convert should build a dummy expression and call convert_from_reference; did your CAST_EXPR work for this test?

In the formal model I'm designing, __is_valid_expr(e) evaluates to
true when e has a type. Although, if I'm instantiating a non-dependent
expression, I'll probably get an error_mark_node if the expression
can't be typed. Right?

Right. Any expression either has a type, is type-dependent, or is erroneous; any erroneous expression will show up as error_mark_node.

+/* The REQ expressions are unary expressions that specify inididual


+  // evaluatd.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]