Re: [PATCH] PR c++/51476 - ICE on PTRMEM_CST as template argument in c++11

2011-12-13 Thread Dodji Seketeli
Jason Merrill writes: > But yes, the patch is OK after fixing the comment. Thanks. Here is what I am bootstrapping. gcc/cp/ PR c++/51476 * pt.c (convert_nontype_argument): Don't call maybe_constant_value for PTRMEM_CST nodes. gcc/testsuite/ PR c++/51476

Re: [PATCH] PR c++/51476 - ICE on PTRMEM_CST as template argument in c++11

2011-12-13 Thread Jason Merrill
On 12/13/2011 02:03 PM, Jason Merrill wrote: On 12/13/2011 12:43 PM, Dodji Seketeli wrote: + if (TREE_CODE (expr) == PTRMEM_CST) + /* We don't need to test if a PTRMEM_CST is a constant value + because maybe_constant_value might crash and because + [temp.arg.nontype]/1 says it's not allowed as a

Re: [PATCH] PR c++/51476 - ICE on PTRMEM_CST as template argument in c++11

2011-12-13 Thread Jason Merrill
On 12/13/2011 12:43 PM, Dodji Seketeli wrote: + if (TREE_CODE (expr) == PTRMEM_CST) + /* We don't need to test if a PTRMEM_CST is a constant value + because maybe_constant_value might crash and because + [temp.arg.nontype]/1 says it's not allowed as a template +

Re: [PATCH] PR c++/51476 - ICE on PTRMEM_CST as template argument in c++11

2011-12-13 Thread Dodji Seketeli
Jason Merrill writes: > Let's check for PTRMEM_CST separately, before any of the other tests. Like this? I still need to run it through bootstrap ... gcc/cp/ PR c++/51476 * pt.c (convert_nontype_argument): Don't call maybe_constant_value for PTRMEM_CST nodes. gcc/test

Re: [PATCH] PR c++/51476 - ICE on PTRMEM_CST as template argument in c++11

2011-12-13 Thread Jason Merrill
On 12/13/2011 10:50 AM, Dodji Seketeli wrote: - if (INTEGRAL_OR_ENUMERATION_TYPE_P (type)) + if (INTEGRAL_OR_ENUMERATION_TYPE_P (type) + && TREE_CODE (expr) != PTRMEM_CST) expr = maybe_constant_value (expr); else if (TYPE_PTR_P (type) || (TYPE_PTR_T

[PATCH] PR c++/51476 - ICE on PTRMEM_CST as template argument in c++11

2011-12-13 Thread Dodji Seketeli
Hello, In the example of the patch, we crash because convert_nontype_argument calls maybe_constant_value with the PTRMEM_CST for &B::i (in cxx0x mode) which ends up trying to poke at the offset of i, but struct B is not yet laid out. My understanding is that using a pointer to non-static member a