From: Jason Merrill Date: Mon, 7 Nov 2011 22:52:23 +0000 (-0500) Subject: re PR c++/50870 ([C++0x] [4.6/4.7 Regression] ICE with decltype, operator->, and... X-Git-Tag: releases/gcc-4.7.0~2375 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2b5f337dc066ab64e5a165779146494dfb8fde0;p=thirdparty%2Fgcc.git re PR c++/50870 ([C++0x] [4.6/4.7 Regression] ICE with decltype, operator->, and default template arguments) PR c++/50870 * pt.c (tsubst_copy): Handle NAMESPACE_DECL. (tsubst_copy_and_build) [COMPONENT_REF]: Handle a still-dependent object. From-SVN: r181131 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f75fcc20e73c..4945fd9c912c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2011-11-07 Jason Merrill + + PR c++/50870 + * pt.c (tsubst_copy): Handle NAMESPACE_DECL. + (tsubst_copy_and_build) [COMPONENT_REF]: Handle a still-dependent + object. + 2011-11-07 Paolo Carlini * pt.c (tsubst_copy_and_build): Fix qualified_name_lookup_error diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index c4f4a941e7e4..53a53580deae 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -12010,6 +12010,9 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl) mark_used (t); return t; + case NAMESPACE_DECL: + return t; + case OVERLOAD: /* An OVERLOAD will always be a non-dependent overload set; an overload set from function scope will just be represented with an @@ -13871,7 +13874,9 @@ tsubst_copy_and_build (tree t, if (member == error_mark_node) return error_mark_node; - if (object_type && !CLASS_TYPE_P (object_type)) + if (type_dependent_expression_p (object)) + /* We can't do much here. */; + else if (!CLASS_TYPE_P (object_type)) { if (SCALAR_TYPE_P (object_type)) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1560c27c25d1..e2eccc556807 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-11-07 Jason Merrill + + PR c++/50870 + * g++.dg/cpp0x/decltype35.C: New. + 2011-11-07 Dodji Seketeli Support C++11 alias-declaration diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype35.C b/gcc/testsuite/g++.dg/cpp0x/decltype35.C new file mode 100644 index 000000000000..d1fd47638a94 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/decltype35.C @@ -0,0 +1,15 @@ +// PR c++/50870 +// { dg-options -std=c++0x } + +template + struct impl + { + template static T create(); + }; + +template ::template create() + -> impl::template create())> +struct tester { }; + +tester*, int, float> ti;