[cfe-commits] r67059 - in /cfe/trunk: include/clang/AST/ include/clang/Basic/ lib/AST/ lib/CodeGen/ lib/Sema/ test/Parser/ test/SemaCXX/

Douglas Gregor dgregor at apple.com
Mon Mar 23 09:35:35 PDT 2009


On Mar 21, 2009, at 8:11 AM, Howard Hinnant wrote:

> On Mar 20, 2009, at 4:17 PM, Douglas Gregor wrote:
>
>> Howard, there's a question for you below. Just search for your name.
>
> I didn't see a question.

Errr, sorry. The question was: do you agree that the following code  
should be ill-
formed?

   struct A { };

   struct B {
     operator A&&();
   }

   void test(B b) {
     const A &ar = b; // error: operator A&&() returns an rvalue, so  
it should not be considered when trying to bind ar to b
   }
>
>> On the testing front, we should import Howard's rvalue-reference  
>> tests
>> to make sure we've covered everything that we can do now. We  
>> obviously
>> can't implement the template-argument deduction bits, but we can test
>> reference-collapsing in template instantiations, and most everything
>> else.
>
> I think we may have to wait until further template support.  Just  
> glancing at reference_collapsing.C it needs:
>
> *  static_assert (which I think we have now)
>
> *  remove_reference
> *  is_lvalue_reference
> *  is_rvalue_reference
> *  is_const
> *  is_volatile
>
> (i.e. type_traits which the test has replicated).
>
> I believe we need partial specialization to run these tests.  I'd  
> love to be proven wrong though... ;-)


Okay, then we'll probably have to wait until we have enough class  
template partial specialization to implement these type traits.

	- Doug



More information about the cfe-commits mailing list