This is the mail archive of the gcc-patches@gcc.gnu.org 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: Require canonical type comparison for typedefs again.


On 10/23/2010 04:53 PM, Dodji Seketeli wrote:
We also catch more errors at this point. In template/crash55.C, we have
this:

template<typename class T, T = T()> struct A {};

Now that the default argument goes through tsubst we emit this message:

test.cc:1:34: error: a cast to a type other than an integral or
enumeration type cannot appear in a constant-expression

I don't know if the error message is useful, but I believe it's
correct. So I adjusted the test.

No, it isn't correct; we need to allow T(), because T might be int when we instantiate the template.


Jason


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