[Bug c++/43382] [C++0x] ICE with auto return type and variadic templates

2020-04-20 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43382

--- Comment #8 from CVS Commits  ---
The master branch has been updated by Patrick Palka :

https://gcc.gnu.org/g:a3a4f6be0c7ac1536c4d1def14217840b04dd488

commit r10-7835-ga3a4f6be0c7ac1536c4d1def14217840b04dd488
Author: Patrick Palka 
Date:   Mon Apr 20 18:34:00 2020 -0400

c++: Recursive unification with packs and explicit targs [PR94628]

This PR seems to be similar to PR c++/43382, except that the recursive call
to
the variadic function with trailing return type in this testcase is
additionally
given some explicit template arguments.

In the first testcase below, when resolving the recursive call to 'select',
fn_type_unification first substitutes in the call's explicit template
arguments
before doing unification, and so during this substitution the template
argument
pack for Args is incomplete.

Since the pack is incomplete, the substitution of 'args...' in the trailing
return type decltype(f(args...)) is handled by the unsubstituted_packs case
of
tsubst_pack_expansion.  But the handling of this case happens _before_ we
reset
local_specializations, and so the substitution ends up reusing the old
binding
for 'args' from local_specializations rather than building a new one.

This patch fixes this issue by setting up local_specializations sooner in
tsubst_pack_expansion, before the handling of the unsubstituted_packs case.
It also adds a new policy to local_specialization_stack so that we could
use the
class here to conditionally replace local_specializations.

gcc/cp/ChangeLog:

PR c++/94628
* cp-tree.h (lss_policy::lss_nop): New enumerator.
* pt.c (local_specialization_stack::local_specialization_stack):
Handle
an lss_nop policy.
(local_specialization_stack::~local_specialization_stack):
Likewise.
(tsubst_pack_expansion): Use a local_specialization_stack instead
of
manually saving and restoring local_specializations.  Conditionally
replace local_specializations sooner, before the handling of the
unsubstituted_packs case.

gcc/testsuite/ChangeLog:

PR c++/94628
* g++.dg/cpp0x/variadic179.C: New test.
* g++.dg/cpp0x/variadic180.C: New test.

[Bug c++/43382] [C++0x] ICE with auto return type and variadic templates

2010-05-26 Thread jason at gcc dot gnu dot org


--- Comment #5 from jason at gcc dot gnu dot org  2010-05-26 15:00 ---
Subject: Bug 43382

Author: jason
Date: Wed May 26 15:00:02 2010
New Revision: 159873

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=159873
Log:
PR c++/43382
* pt.c (fn_type_unification): Don't get confused by recursive
unification.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/variadic101.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43382



[Bug c++/43382] [C++0x] ICE with auto return type and variadic templates

2010-05-26 Thread jason at gcc dot gnu dot org


--- Comment #6 from jason at gcc dot gnu dot org  2010-05-26 15:19 ---
Subject: Bug 43382

Author: jason
Date: Wed May 26 15:18:46 2010
New Revision: 159875

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=159875
Log:
PR c++/43382
* pt.c (fn_type_unification): Don't get confused by recursive
unification.

Added:
branches/gcc-4_5-branch/gcc/testsuite/g++.dg/cpp0x/variadic101.C
Modified:
branches/gcc-4_5-branch/gcc/cp/ChangeLog
branches/gcc-4_5-branch/gcc/cp/pt.c
branches/gcc-4_5-branch/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43382



[Bug c++/43382] [C++0x] ICE with auto return type and variadic templates

2010-05-26 Thread jason at gcc dot gnu dot org


--- Comment #7 from jason at gcc dot gnu dot org  2010-05-26 17:15 ---
Fixed for 4.5.1.


-- 

jason at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.5.1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43382



[Bug c++/43382] [C++0x] ICE with auto return type and variadic templates

2010-05-25 Thread jason at gcc dot gnu dot org


-- 

jason at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jason at gcc dot gnu dot org
   |dot org |
 Status|NEW |ASSIGNED
   Last reconfirmed|2010-03-16 10:27:59 |2010-05-26 04:59:29
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43382