From 7e99dceb0edec587baecf2badc7de69b0cc86968 Mon Sep 17 00:00:00 2001 From: jason Date: Thu, 24 May 2018 14:27:10 +0000 Subject: [PATCH] PR c++/85864 - literal template and default template arg. * pt.c (instantiation_dependent_r): Handle NONTYPE_ARGUMENT_PACK. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@260672 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/pt.c | 1 + gcc/testsuite/g++.dg/cpp1y/udlit-char-template2.C | 23 +++++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp1y/udlit-char-template2.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4f4c9e78f1e..c8832a168f9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2018-05-24 Jason Merrill + + PR c++/85864 - literal template and default template arg. + * pt.c (instantiation_dependent_r): Handle NONTYPE_ARGUMENT_PACK. + 2018-05-24 Marek Polacek PR c++/85847 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 0b04770e123..d1181055af4 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -25212,6 +25212,7 @@ instantiation_dependent_r (tree *tp, int *walk_subtrees, TREE_TYPE. */ case TREE_LIST: case TREE_VEC: + case NONTYPE_ARGUMENT_PACK: return NULL_TREE; case TEMPLATE_PARM_INDEX: diff --git a/gcc/testsuite/g++.dg/cpp1y/udlit-char-template2.C b/gcc/testsuite/g++.dg/cpp1y/udlit-char-template2.C new file mode 100644 index 00000000000..06c13261156 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/udlit-char-template2.C @@ -0,0 +1,23 @@ +// PR c++/85864 +// { dg-do compile { target c++14 } } + +template struct String_template {}; + +template +constexpr String_template operator""_template() { + return String_template {}; +} + +template +int hex(T v) { return 1; } + +template +void tt2() { + // auto h2 = hex(1); + auto h = hex(2); +} + +int main() { + // auto h = hex(2); + // return h; +} -- 2.11.4.GIT