[PR c++/84702] ICE with default tmpl arg of overload set
https://gcc.gnu.org/ml/gcc-patches/2018-03/msg00227.html PR c++/84702 * pt.c (process_template_arg): Mark lookup_keep on a default arg. PR c++/84702 * g++.dg/lookup/pr84702.C: New. From-SVN: r258258
This commit is contained in:
parent
537400180d
commit
f7af3ad637
@ -1,3 +1,8 @@
|
||||
2018-03-05 Nathan Sidwell <nathan@acm.org>
|
||||
|
||||
PR c++/84702
|
||||
* pt.c (process_template_arg): Mark lookup_keep on a default arg.
|
||||
|
||||
2018-03-05 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c++/84707
|
||||
|
@ -4425,6 +4425,9 @@ process_template_parm (tree list, location_t parm_loc, tree parm,
|
||||
|
||||
pushdecl (decl);
|
||||
|
||||
if (defval && TREE_CODE (defval) == OVERLOAD)
|
||||
lookup_keep (defval, true);
|
||||
|
||||
/* Build the parameter node linking the parameter declaration,
|
||||
its default argument (if any), and its constraints (if any). */
|
||||
parm = build_tree_list (defval, parm);
|
||||
|
@ -1,3 +1,8 @@
|
||||
2018-03-05 Nathan Sidwell <nathan@acm.org>
|
||||
|
||||
PR c++/84702
|
||||
* g++.dg/lookup/pr84702.C: New.
|
||||
|
||||
2018-03-05 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR target/84564
|
||||
|
13
gcc/testsuite/g++.dg/lookup/pr84702.C
Normal file
13
gcc/testsuite/g++.dg/lookup/pr84702.C
Normal file
@ -0,0 +1,13 @@
|
||||
// PR c++/84702 failure to mark overload to keep
|
||||
// { dg-do compile { target c++11 } }
|
||||
|
||||
void a ();
|
||||
|
||||
namespace {
|
||||
void a (int);
|
||||
}
|
||||
|
||||
template<void (&b)() = a>
|
||||
void c () {
|
||||
c ();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user