On Thu, Jun 23, 2011 at 8:07 PM, H.J. Lu <hjl.to...@gmail.com> wrote: > On Thu, Jun 23, 2011 at 7:18 PM, Jason Merrill <ja...@redhat.com> wrote: >> On 06/23/2011 08:45 PM, H.J. Lu wrote: >>> >>> This caused: >>> >>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49519 >> >> I'm checking this in as an alternate fix. Testing hasn't completed yet, but >> I'm confident that this version is safe. >> > > I still got the same failure with revision 175368. The problem is caused by > the "While looking at this, I've also changed a few more TYPE_MAIN_VARIANTs > to cv_unqualified" change in > > http://gcc.gnu.org/ml/gcc-patches/2011-06/msg01622.html
Revert this patch: diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 4d2caa8..2716f78 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -10246,7 +10246,7 @@ tsubst_arg_types (tree arg_types, /* Do array-to-pointer, function-to-pointer conversion, and ignore top-level qualifiers as required. */ - type = TYPE_MAIN_VARIANT (type_decays_to (type)); + type = cv_unqualified (type_decays_to (type)); /* We do not substitute into default arguments here. The standard mandates that they be instantiated only when needed, which is seems to fix the crash. -- H.J.