public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/112737] New: [14 Regression] g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors)
@ 2023-11-27 23:09 hp at gcc dot gnu.org
2023-11-28 0:06 ` [Bug c++/112737] " redi at gcc dot gnu.org
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: hp at gcc dot gnu.org @ 2023-11-27 23:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112737
Bug ID: 112737
Summary: [14 Regression] g++.dg/modules/xtreme-header-2_b.C
-std=c++2b (test for excess errors)
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: hp at gcc dot gnu.org
CC: redi at gcc dot gnu.org
Target Milestone: ---
Target: cris-elf
With r14-5794-g7a6a29c455e775 "libstdc++: Define std::ranges::to for C++23
(P1206R7) [PR111055]" this test-suite regression was introduced for various
targets:
Running /x/gcc/testsuite/g++.dg/modules/modules.exp ...
[...]
FAIL: g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors)
According to g++.log, for cris-elf:
Excess errors:
/src/gcc/testsuite/g++.dg/modules/xtreme-header-2_a.H: error: conflicting
global module declaration 'template<template<class ...> class _Cont, class _Rg,
class ... _Args> using std::ranges::__detail::_DeduceExpr1 = decltype
(_Cont<...auto...>(declval<_Rg>(), (declval<_Args>)()...))'
/src/gcc/testsuite/g++.dg/modules/xtreme-header-2_a.H: error: conflicting
global module declaration 'template<template<class ...> class _Cont, class _Rg,
class ... _Args> using std::ranges::__detail::_DeduceExpr2 = decltype
(_Cont<...auto...>(std::from_range, declval<_Rg>(), (declval<_Args>)()...))'
/src/gcc/testsuite/g++.dg/modules/xtreme-header-2_a.H: error: conflicting
global module declaration 'template<template<class ...> class _Cont, class _Rg,
class ... _Args> using std::ranges::__detail::_DeduceExpr3 = decltype
(_Cont<...auto...>(declval<std::ranges::__detail::_InputIter<_Rg> >(),
declval<std::ranges::__detail::_InputIter<_Rg> >(), (declval<_Args>)()...))'
/src/gcc/testsuite/g++.dg/modules/xtreme-header-2_a.H: error: conflicting
global module declaration 'using std::ranges::__detail::_DeduceExpr1 = decltype
(_Cont<...auto...>(declval<_Rg>(), (declval<_Args>)()...))'
/src/gcc/testsuite/g++.dg/modules/xtreme-header-2_a.H: error: conflicting
global module declaration 'using std::ranges::__detail::_DeduceExpr2 = decltype
(_Cont<...auto...>(std::from_range, declval<_Rg>(), (declval<_Args>)()...))'
/src/gcc/testsuite/g++.dg/modules/xtreme-header-2_a.H: error: conflicting
global module declaration 'using std::ranges::__detail::_DeduceExpr3 = decltype
(_Cont<...auto...>(declval<std::ranges::__detail::_InputIter<_Rg> >(),
declval<std::ranges::__detail::_InputIter<_Rg> >(), (declval<_Args>)()...))'
This appears to happen also for "aarch64":
https://gcc.gnu.org/pipermail/gcc-regression/2023-November/078616.html
and "Linux/x86_64":
https://gcc.gnu.org/pipermail/gcc-regression/2023-November/078617.html
suggesting that most targets are affected.
(Maintainers, please adjust your scripts to include a full gnu target tuple in
your autotester messages in those places where the abbreviated quoted ones are
found, so that readers can cut-and-paste that key information for e.g.
additional targets in bug-reports, QED. Additional steps such as following
links should not be necessary.)
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/112737] [14 Regression] g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors)
2023-11-27 23:09 [Bug c++/112737] New: [14 Regression] g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors) hp at gcc dot gnu.org
@ 2023-11-28 0:06 ` redi at gcc dot gnu.org
2023-12-06 15:55 ` danglin at gcc dot gnu.org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2023-11-28 0:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112737
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=101095
Last reconfirmed| |2023-11-28
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The errors remind me of PR101095. Maybe the fix will be similar.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/112737] [14 Regression] g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors)
2023-11-27 23:09 [Bug c++/112737] New: [14 Regression] g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors) hp at gcc dot gnu.org
2023-11-28 0:06 ` [Bug c++/112737] " redi at gcc dot gnu.org
@ 2023-12-06 15:55 ` danglin at gcc dot gnu.org
2023-12-11 18:00 ` ppalka at gcc dot gnu.org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: danglin at gcc dot gnu.org @ 2023-12-06 15:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112737
John David Anglin <danglin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |danglin at gcc dot gnu.org
Target|cris-elf |cris-elf
| |hppa-unknown-linux-gnu
--- Comment #2 from John David Anglin <danglin at gcc dot gnu.org> ---
Same errors occur on hppa-linux-gnu.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/112737] [14 Regression] g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors)
2023-11-27 23:09 [Bug c++/112737] New: [14 Regression] g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors) hp at gcc dot gnu.org
2023-11-28 0:06 ` [Bug c++/112737] " redi at gcc dot gnu.org
2023-12-06 15:55 ` danglin at gcc dot gnu.org
@ 2023-12-11 18:00 ` ppalka at gcc dot gnu.org
2023-12-12 1:49 ` ppalka at gcc dot gnu.org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: ppalka at gcc dot gnu.org @ 2023-12-11 18:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112737
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |14.0
CC| |ppalka at gcc dot gnu.org
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/112737] [14 Regression] g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors)
2023-11-27 23:09 [Bug c++/112737] New: [14 Regression] g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors) hp at gcc dot gnu.org
` (2 preceding siblings ...)
2023-12-11 18:00 ` ppalka at gcc dot gnu.org
@ 2023-12-12 1:49 ` ppalka at gcc dot gnu.org
2024-01-13 19:07 ` danglin at gcc dot gnu.org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: ppalka at gcc dot gnu.org @ 2023-12-12 1:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112737
--- Comment #3 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Created attachment 56858
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56858&action=edit
untested fix
Changing CLASS_PLACEHOLDER_TEMPLATE of a CTAD placeholder that names a ttp to
point to the ttp's TEMPLATE_TEMPLATE_PARM node instead of its TEMPLATE_DECL
seems to fix the issue, but I'm not sure if this is what we really want...
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/112737] [14 Regression] g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors)
2023-11-27 23:09 [Bug c++/112737] New: [14 Regression] g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors) hp at gcc dot gnu.org
` (3 preceding siblings ...)
2023-12-12 1:49 ` ppalka at gcc dot gnu.org
@ 2024-01-13 19:07 ` danglin at gcc dot gnu.org
2024-01-31 14:58 ` ppalka at gcc dot gnu.org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: danglin at gcc dot gnu.org @ 2024-01-13 19:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112737
--- Comment #4 from John David Anglin <danglin at gcc dot gnu.org> ---
On hppa64-hp-hpux11.11:
Excess errors:
/home/dave/gnu/gcc/gcc/gcc/testsuite/g++.dg/modules/xtreme-header-2_a.H: error:
conflicting global module declaration 'template<template<class ...> class
_Cont, class _Rg, class ... _Args> using std::ranges::__detail::_DeduceExpr1 =
decltype (_Cont<...auto...>(declval<_Rg>(), (declval<_Args>)()...))'
/home/dave/gnu/gcc/gcc/gcc/testsuite/g++.dg/modules/xtreme-header-2_a.H: error:
conflicting global module declaration 'template<template<class ...> class
_Cont, class _Rg, class ... _Args> using std::ranges::__detail::_DeduceExpr2 =
decltype (_Cont<...auto...>(std::from_range, declval<_Rg>(),
(declval<_Args>)()...))'
/home/dave/gnu/gcc/gcc/gcc/testsuite/g++.dg/modules/xtreme-header-2_a.H: error:
conflicting global module declaration 'template<template<class ...> class
_Cont, class _Rg, class ... _Args> using std::ranges::__detail::_DeduceExpr3 =
decltype (_Cont<...auto...>(declval<std::ranges::__detail::_InputIter<_Rg> >(),
declval<std::ranges::__detail::_InputIter<_Rg> >(), (declval<_Args>)()...))'
/home/dave/gnu/gcc/gcc/gcc/testsuite/g++.dg/modules/xtreme-header-2_a.H: error:
conflicting global module declaration 'using
std::ranges::__detail::_DeduceExpr1 = decltype
(_Cont<...auto...>(declval<_Rg>(), (declval<_Args>)()...))'
/home/dave/gnu/gcc/gcc/gcc/testsuite/g++.dg/modules/xtreme-header-2_a.H: error:
conflicting global module declaration 'using
std::ranges::__detail::_DeduceExpr2 = decltype
(_Cont<...auto...>(std::from_range, declval<_Rg>(), (declval<_Args>)()...))'
/home/dave/gnu/gcc/gcc/gcc/testsuite/g++.dg/modules/xtreme-header-2_a.H: error:
conflicting global module declaration 'using
std::ranges::__detail::_DeduceExpr3 = decltype
(_Cont<...auto...>(declval<std::ranges::__detail::_InputIter<_Rg> >(),
declval<std::ranges::__detail::_InputIter<_Rg> >(), (declval<_Args>)()...))'
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/112737] [14 Regression] g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors)
2023-11-27 23:09 [Bug c++/112737] New: [14 Regression] g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors) hp at gcc dot gnu.org
` (4 preceding siblings ...)
2024-01-13 19:07 ` danglin at gcc dot gnu.org
@ 2024-01-31 14:58 ` ppalka at gcc dot gnu.org
2024-01-31 15:32 ` ppalka at gcc dot gnu.org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-01-31 14:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112737
--- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Reduced:
$ cat 112737.h
template<template<class> class _Cont>
using _DeduceExpr1 = decltype(_Cont{});
$ cat 112737_a.H
#include "112737.h"
$ cat 112737_b.C
import "112737_a.H";
#include "112737.h"
$ g++ -fmodules-ts 112737_a.H 112737_b.C
In file included from 112737_b.C:2:
112737.h:2:7: error: conflicting declaration of template
‘template<template<class> class _Cont> using _DeduceExpr1 = decltype
(_Cont<...auto...>{})’
2 | using _DeduceExpr1 = decltype(_Cont{});
| ^~~~~~~~~~~~
In file included from 112737_a.H:1,
of module ./112737_a.H, imported at 112737_b.C:1:
112737.h:2:7: note: previous declaration ‘template<template<class> class _Cont>
using _DeduceExpr1 = decltype (_Cont<...auto...>{})’
2 | using _DeduceExpr1 = decltype(_Cont{});
| ^~~~~~~~~~~~
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/112737] [14 Regression] g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors)
2023-11-27 23:09 [Bug c++/112737] New: [14 Regression] g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors) hp at gcc dot gnu.org
` (5 preceding siblings ...)
2024-01-31 14:58 ` ppalka at gcc dot gnu.org
@ 2024-01-31 15:32 ` ppalka at gcc dot gnu.org
2024-01-31 15:47 ` ppalka at gcc dot gnu.org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-01-31 15:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112737
--- Comment #6 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Ah, this seems to be a general declaration matching issue not specific to
modules. Here's a non-modules testcase:
template<template<class> class TT, class T>
decltype(TT{T()}) f(); // #1
template<template<class> class TT, class T>
decltype(TT{T()}) f(); // #2, should be considered a redeclaration of #1
template<class T> struct A { A(T); };
int main() {
f<A, int>(); // ambiguity error
}
We (wrongly?) consider the return types of the two f's to be different, because
the CTAD placeholders refer to different TEMPLATE_DECLs (of a logically
equivalent ttp) and structural_comptypes uses pointer identity here. Perhaps
we need to relax structural_comptypes in this case.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/112737] [14 Regression] g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors)
2023-11-27 23:09 [Bug c++/112737] New: [14 Regression] g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors) hp at gcc dot gnu.org
` (6 preceding siblings ...)
2024-01-31 15:32 ` ppalka at gcc dot gnu.org
@ 2024-01-31 15:47 ` ppalka at gcc dot gnu.org
2024-02-01 18:18 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-01-31 15:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112737
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |ppalka at gcc dot gnu.org
--- Comment #7 from Patrick Palka <ppalka at gcc dot gnu.org> ---
(In reply to Patrick Palka from comment #6)
> Perhaps we need to relax structural_comptypes in this case.
I guess I can submit a patch to that effect.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/112737] [14 Regression] g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors)
2023-11-27 23:09 [Bug c++/112737] New: [14 Regression] g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors) hp at gcc dot gnu.org
` (7 preceding siblings ...)
2024-01-31 15:47 ` ppalka at gcc dot gnu.org
@ 2024-02-01 18:18 ` cvs-commit at gcc dot gnu.org
2024-02-01 18:19 ` ppalka at gcc dot gnu.org
2024-02-02 13:25 ` hp at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-02-01 18:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112737
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:3ba5be16a2be3eaedf2870ca1e25cfe826945948
commit r14-8705-g3ba5be16a2be3eaedf2870ca1e25cfe826945948
Author: Patrick Palka <ppalka@redhat.com>
Date: Thu Feb 1 13:17:48 2024 -0500
c++: ttp TEMPLATE_DECL equivalence [PR112737]
Here during declaration matching we undesirably consider the two TT{42}
CTAD expressions to be non-equivalent ultimately because for CTAD
placeholder equivalence we compare the TEMPLATE_DECLs via pointer identity,
and here the corresponding TEMPLATE_DECLs for TT are different since
they're from different scopes. On the other hand, the corresponding
TEMPLATE_TEMPLATE_PARMs are deemed equivalent according to cp_tree_equal
(since they have the same position and template parameters). This turns
out to be the root cause of some of the xtreme-header modules regressions.
So this patch relaxes ttp CTAD placeholder equivalence accordingly, by
comparing the TEMPLATE_TEMPLATE_PARM instead of the TEMPLATE_DECL. It
turns out this issue also affects function template-id equivalence as
with g<TT> in the second testcase, so it makes sense to relax TEMPLATE_DECL
equivalence more generally in cp_tree_equal. In passing this patch
improves ctp_hasher::hash for CTAD placeholders, so that they don't
all get the same hash.
PR c++/112737
gcc/cp/ChangeLog:
* pt.cc (iterative_hash_template_arg) <case TEMPLATE_DECL>:
Adjust hashing to match cp_tree_equal.
(ctp_hasher::hash): Also hash CLASS_PLACEHOLDER_TEMPLATE.
* tree.cc (cp_tree_equal) <case TEMPLATE_DECL>: Return true
for ttp TEMPLATE_DECLs if their TEMPLATE_TEMPLATE_PARMs are
equivalent.
* typeck.cc (structural_comptypes) <case TEMPLATE_TYPE_PARM>:
Use cp_tree_equal to compare CLASS_PLACEHOLDER_TEMPLATE.
gcc/testsuite/ChangeLog:
* g++.dg/template/ttp42.C: New test.
* g++.dg/template/ttp43.C: New test.
Reviewed-by: Jason Merrill <jason@redhat.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/112737] [14 Regression] g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors)
2023-11-27 23:09 [Bug c++/112737] New: [14 Regression] g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors) hp at gcc dot gnu.org
` (8 preceding siblings ...)
2024-02-01 18:18 ` cvs-commit at gcc dot gnu.org
@ 2024-02-01 18:19 ` ppalka at gcc dot gnu.org
2024-02-02 13:25 ` hp at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-02-01 18:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112737
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #9 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/112737] [14 Regression] g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors)
2023-11-27 23:09 [Bug c++/112737] New: [14 Regression] g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors) hp at gcc dot gnu.org
` (9 preceding siblings ...)
2024-02-01 18:19 ` ppalka at gcc dot gnu.org
@ 2024-02-02 13:25 ` hp at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: hp at gcc dot gnu.org @ 2024-02-02 13:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112737
--- Comment #10 from Hans-Peter Nilsson <hp at gcc dot gnu.org> ---
Looks like this also fixed one of the remaining FAILs logged in PR112580,
specifically
"FAIL: g++.dg/modules/xtreme-header_b.C -std=c++2b (test for excess errors)".
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2024-02-02 13:25 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-27 23:09 [Bug c++/112737] New: [14 Regression] g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors) hp at gcc dot gnu.org
2023-11-28 0:06 ` [Bug c++/112737] " redi at gcc dot gnu.org
2023-12-06 15:55 ` danglin at gcc dot gnu.org
2023-12-11 18:00 ` ppalka at gcc dot gnu.org
2023-12-12 1:49 ` ppalka at gcc dot gnu.org
2024-01-13 19:07 ` danglin at gcc dot gnu.org
2024-01-31 14:58 ` ppalka at gcc dot gnu.org
2024-01-31 15:32 ` ppalka at gcc dot gnu.org
2024-01-31 15:47 ` ppalka at gcc dot gnu.org
2024-02-01 18:18 ` cvs-commit at gcc dot gnu.org
2024-02-01 18:19 ` ppalka at gcc dot gnu.org
2024-02-02 13:25 ` hp at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).