From: paolo Date: Wed, 29 Jan 2014 17:54:51 +0000 (+0000) Subject: /cp X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9e31b03d69bcb9dc5ccfc638391698b98ed035e5;p=thirdparty%2Fgcc.git /cp 2014-01-29 Paolo Carlini PR c++/58674 * pt.c (instantiate_template_1): Check for error_mark_node the second argument too. /testsuite 2014-01-29 Paolo Carlini PR c++/58674 * g++.dg/cpp0x/pr58674.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207275 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 594861b34b94..ff6493a98b31 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2014-01-29 Paolo Carlini + + PR c++/58674 + * pt.c (instantiate_template_1): Check for error_mark_node the second + argument too. + 2014-01-29 Jason Merrill PR c++/59916 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 7f1b6d506cf8..ce679f6d18e1 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -15258,6 +15258,9 @@ instantiate_template_1 (tree tmpl, tree orig_args, tsubst_flags_t complain) return NULL_TREE; } + if (targ_ptr == error_mark_node) + return error_mark_node; + /* Check to see if we already have this specialization. */ gen_tmpl = most_general_template (tmpl); if (tmpl != gen_tmpl) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0b832ad6ebb0..ce325ca6a071 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-01-29 Paolo Carlini + + PR c++/58674 + * g++.dg/cpp0x/pr58674.C: New. + 2014-01-28 Kirill Yukhin PR target/59617 diff --git a/gcc/testsuite/g++.dg/cpp0x/pr58674.C b/gcc/testsuite/g++.dg/cpp0x/pr58674.C new file mode 100644 index 000000000000..fe97c6de9704 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr58674.C @@ -0,0 +1,18 @@ +// PR c++/58674 +// { dg-do compile { target c++11 } } + +template struct A {}; + +template using B = A; + +template struct C +{ + B b; // { dg-error "not usable" } +}; + +struct X +{ + static const int i; +}; + +C c;