From: Jason Merrill Date: Wed, 18 May 2016 17:40:49 +0000 (-0400) Subject: PR c++/70505 - partial instantiation of template-id X-Git-Tag: releases/gcc-4.9.4~172 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea3d1c80949241693115dc88f5f8e5fa2a497414;p=thirdparty%2Fgcc.git PR c++/70505 - partial instantiation of template-id * pt.c (tsubst_baselink): Give the new TEMPLATE_ID_EXPR unknown_type_node, too. From-SVN: r236420 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3c172ee27b12..6e0c2154f86b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2016-05-18 Jason Merrill + + PR c++/70505 + * pt.c (tsubst_baselink): Give the new TEMPLATE_ID_EXPR + unknown_type_node, too. + 2016-04-13 Alan Modra Backport from mainline diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 4b4cf4ec20bd..e08a27d437bb 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -12392,9 +12392,10 @@ tsubst_baselink (tree baselink, tree object_type, /* Add back the template arguments, if present. */ if (BASELINK_P (baselink) && template_id_p) BASELINK_FUNCTIONS (baselink) - = build_nt (TEMPLATE_ID_EXPR, - BASELINK_FUNCTIONS (baselink), - template_args); + = build2 (TEMPLATE_ID_EXPR, + unknown_type_node, + BASELINK_FUNCTIONS (baselink), + template_args); /* Update the conversion operator type. */ BASELINK_OPTYPE (baselink) = optype; diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-template10.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-template10.C new file mode 100644 index 000000000000..d63f1cc630f8 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-template10.C @@ -0,0 +1,17 @@ +// PR c++/70505 +// { dg-do compile { target c++11 } } + +template +struct s +{ + template + static constexpr T f1(const T x) {return x;} + template (sizeof(T))> + static constexpr T f2(const T x) {return x;} + static void f() {s::f2(42);} +}; + +int main() +{ + s::f(); +}