diff options
author | Marek Polacek <polacek@redhat.com> | 2018-12-04 19:28:27 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2018-12-04 19:28:27 +0000 |
commit | 22f309bc29de788fc686f9f98b194996b109b218 (patch) | |
tree | ae92c44804ef6e3454a3d4b9ac406f6df3bb129e /gcc/cp | |
parent | de117207d722031db5db9a1efafcda900ea14f77 (diff) | |
download | gcc-22f309bc29de788fc686f9f98b194996b109b218.zip gcc-22f309bc29de788fc686f9f98b194996b109b218.tar.gz gcc-22f309bc29de788fc686f9f98b194996b109b218.tar.bz2 |
PR c++/88184 - ICE when treating name as template-name.
* pt.c (lookup_template_function): Always build the TEMPLATE_ID_EXPR
with unknown_type_node.
* g++.dg/cpp2a/fn-template17.C: New test.
* g++.dg/cpp2a/fn-template18.C: New test.
From-SVN: r266793
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/pt.c | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 866fd33..d43d613 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2018-12-04 Marek Polacek <polacek@redhat.com> + + PR c++/88184 - ICE when treating name as template-name. + * pt.c (lookup_template_function): Always build the TEMPLATE_ID_EXPR + with unknown_type_node. + 2018-12-04 Julian Brown <julian@codesourcery.com> * parser.c (cp_parser_oacc_wait_list): Fix error message and avoid diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index a0d899f..78addc6 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -9068,8 +9068,6 @@ add_pending_template (tree d) tree lookup_template_function (tree fns, tree arglist) { - tree type; - if (fns == error_mark_node || arglist == error_mark_node) return error_mark_node; @@ -9090,11 +9088,7 @@ lookup_template_function (tree fns, tree arglist) return fns; } - type = TREE_TYPE (fns); - if (TREE_CODE (fns) == OVERLOAD || !type) - type = unknown_type_node; - - return build2 (TEMPLATE_ID_EXPR, type, fns, arglist); + return build2 (TEMPLATE_ID_EXPR, unknown_type_node, fns, arglist); } /* Within the scope of a template class S<T>, the name S gets bound |