[Bug c++/108347] Incorrect error: ambiguous template instantiation

2023-09-18 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108347

Patrick Palka  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
   Target Milestone|--- |14.0
   Assignee|unassigned at gcc dot gnu.org  |ppalka at gcc dot 
gnu.org
 Resolution|--- |FIXED
 CC||ppalka at gcc dot gnu.org

--- Comment #5 from Patrick Palka  ---
Fixed for GCC 14, thanks for the bug report.

[Bug c++/108347] Incorrect error: ambiguous template instantiation

2023-09-18 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108347

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

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

commit r14-4110-ga6ac1fc64c3caed19da65c2e6b12f8ddaf551231
Author: Patrick Palka 
Date:   Mon Sep 18 14:41:07 2023 -0400

c++: unifying identical tmpls from current inst [PR108347]

Here more_specialized_partial_spec wrongly considers the two partial
specializations to be unordered ultimately because unify for identical
parm=arg=A::C returns failure due to C being dependent.

This patch fixes this by relaxing unify's early-exit identity test to
also accept dependent decls; we can't deduce anything further from them
anyway.  In passing this patch removes the CONST_DECL case of unify:
we should never see the CONST_DECL version of a template parameter here,
and for other CONST_DECLs (such as enumerators) it seems we can rely on
them to already have been folded to their DECL_INITIAL.

PR c++/108347

gcc/cp/ChangeLog:

* pt.cc (unify): Return unify_success for identical dependent
DECL_P 'arg' and 'parm'.
: Remove handling.

gcc/testsuite/ChangeLog:

* g++.dg/template/ttp41.C: New test.

[Bug c++/108347] Incorrect error: ambiguous template instantiation

2023-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108347

--- Comment #3 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #2)
> Created attachment 54223 [details]
> testcase that removes the C++17isms and convert it over to C++11

The reason why I did this is because I wanted to see if older versions of GCC
rejected this code and they do in a similar fashion. (MSVC still ICEs).

[Bug c++/108347] Incorrect error: ambiguous template instantiation

2023-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108347

--- Comment #2 from Andrew Pinski  ---
Created attachment 54223
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54223=edit
testcase that removes the C++17isms and convert it over to C++11

[Bug c++/108347] Incorrect error: ambiguous template instantiation

2023-01-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108347

--- Comment #1 from Andrew Pinski  ---
Well MSVC has an internal compiler error  with this code.