* [Bug c++/115672] Incorrect template type parameter deduced in non-deduced context if class template has template template parameter
2024-06-27 0:31 [Bug c++/115672] New: Incorrect template type parameter deduced in non-deduced context if class template has template template parameter s.murthy at outlook dot com
@ 2024-06-27 0:33 ` s.murthy at outlook dot com
2024-06-27 0:34 ` s.murthy at outlook dot com
` (14 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: s.murthy at outlook dot com @ 2024-06-27 0:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115672
--- Comment #1 from Sean Murthy <s.murthy at outlook dot com> ---
Created attachment 58525
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58525&action=edit
Pre-processed file for repro source
Produced with GCC 14.1. static_asserts adjusted (negations where it fails
incorrectly) such that program compiles successfully.
g++ -v -save-temps -std=c++20 -Wall -Wextra -pedantic -pedantic-errors
-Werror=pedantic ..\src\main.cpp
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/115672] Incorrect template type parameter deduced in non-deduced context if class template has template template parameter
2024-06-27 0:31 [Bug c++/115672] New: Incorrect template type parameter deduced in non-deduced context if class template has template template parameter s.murthy at outlook dot com
2024-06-27 0:33 ` [Bug c++/115672] " s.murthy at outlook dot com
@ 2024-06-27 0:34 ` s.murthy at outlook dot com
2024-06-27 1:37 ` pinskia at gcc dot gnu.org
` (13 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: s.murthy at outlook dot com @ 2024-06-27 0:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115672
--- Comment #2 from Sean Murthy <s.murthy at outlook dot com> ---
Created attachment 58526
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58526&action=edit
Compiler output for the repro
Produced with GCC 14.1. static_asserts adjusted (negations where it fails
incorrectly) such that program compiles successfully.
g++ -v -save-temps -std=c++20 -Wall -Wextra -pedantic -pedantic-errors
-Werror=pedantic ..\src\main.cpp
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/115672] Incorrect template type parameter deduced in non-deduced context if class template has template template parameter
2024-06-27 0:31 [Bug c++/115672] New: Incorrect template type parameter deduced in non-deduced context if class template has template template parameter s.murthy at outlook dot com
2024-06-27 0:33 ` [Bug c++/115672] " s.murthy at outlook dot com
2024-06-27 0:34 ` s.murthy at outlook dot com
@ 2024-06-27 1:37 ` pinskia at gcc dot gnu.org
2024-06-27 1:45 ` [Bug c++/115672] [11/12/13/14/15 Regression] " pinskia at gcc dot gnu.org
` (12 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-27 1:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115672
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 58527
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58527&action=edit
Remove the inline and change the static_assert to what other compilers should
do
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/115672] [11/12/13/14/15 Regression] Incorrect template type parameter deduced in non-deduced context if class template has template template parameter
2024-06-27 0:31 [Bug c++/115672] New: Incorrect template type parameter deduced in non-deduced context if class template has template template parameter s.murthy at outlook dot com
` (2 preceding siblings ...)
2024-06-27 1:37 ` pinskia at gcc dot gnu.org
@ 2024-06-27 1:45 ` pinskia at gcc dot gnu.org
2024-06-27 1:52 ` pinskia at gcc dot gnu.org
` (11 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-27 1:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115672
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |11.5
Summary|Incorrect template type |[11/12/13/14/15 Regression]
|parameter deduced in |Incorrect template type
|non-deduced context if |parameter deduced in
|class template has template |non-deduced context if
|template parameter |class template has template
| |template parameter
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/115672] [11/12/13/14/15 Regression] Incorrect template type parameter deduced in non-deduced context if class template has template template parameter
2024-06-27 0:31 [Bug c++/115672] New: Incorrect template type parameter deduced in non-deduced context if class template has template template parameter s.murthy at outlook dot com
` (3 preceding siblings ...)
2024-06-27 1:45 ` [Bug c++/115672] [11/12/13/14/15 Regression] " pinskia at gcc dot gnu.org
@ 2024-06-27 1:52 ` pinskia at gcc dot gnu.org
2024-06-27 1:52 ` pinskia at gcc dot gnu.org
` (10 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-27 1:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115672
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #58527|0 |1
is obsolete| |
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 58528
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58528&action=edit
Reduced further
The second t argument type in the template definition is the key I think.
Changing it to just class allows the testcase to work.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/115672] [11/12/13/14/15 Regression] Incorrect template type parameter deduced in non-deduced context if class template has template template parameter
2024-06-27 0:31 [Bug c++/115672] New: Incorrect template type parameter deduced in non-deduced context if class template has template template parameter s.murthy at outlook dot com
` (4 preceding siblings ...)
2024-06-27 1:52 ` pinskia at gcc dot gnu.org
@ 2024-06-27 1:52 ` pinskia at gcc dot gnu.org
2024-06-27 3:22 ` s.murthy at outlook dot com
` (9 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-27 1:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115672
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Last reconfirmed| |2024-06-27
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/115672] [11/12/13/14/15 Regression] Incorrect template type parameter deduced in non-deduced context if class template has template template parameter
2024-06-27 0:31 [Bug c++/115672] New: Incorrect template type parameter deduced in non-deduced context if class template has template template parameter s.murthy at outlook dot com
` (5 preceding siblings ...)
2024-06-27 1:52 ` pinskia at gcc dot gnu.org
@ 2024-06-27 3:22 ` s.murthy at outlook dot com
2024-06-28 0:19 ` s.murthy at outlook dot com
` (8 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: s.murthy at outlook dot com @ 2024-06-27 3:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115672
--- Comment #6 from Sean Murthy <s.murthy at outlook dot com> ---
(In reply to Andrew Pinski from comment #4)
> Created attachment 58528 [details]
> Reduced further
>
> The second t argument type in the template definition is the key I think.
> Changing it to just class allows the testcase to work.
Yes, both observations I made in my follow up to 115656 apply here as well:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115656#c6
Those two observations give me the inkling the template template parameter and
the template it references both being constrained is likely causing the issue:
each of the observations call for only of those two to be constrained which
causes the compiler to produce the expected output.
Not surprisingly, the third point I made in that 115656 follow up also applies
here: in the initial repro, use type_traits to constrain the class template dv,
and that causes CTAD fail on the deducing ctor, regardless of if/how the
template template parameter is constrained. This behavior suggests to me an
issue with traits-concepts interplay/substitutability. And this behavior goes
all the way back to GCC 10.1, making that particular aspect not a regression
issue (unless something traits-specific pre-C++20 issue exists).
A a1(45ul); //ctad fail if dv template constrained using traits
See: https://sigcpp.godbolt.org/z/GqaPhG17W
BTW thanks to all the GCC devs and maintainers for the awesome product and
follow up. And please forgive me when I use incorrect C++ terminology. I'm just
a 3/10 C++ programmer fumbling my way around. 🙏
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/115672] [11/12/13/14/15 Regression] Incorrect template type parameter deduced in non-deduced context if class template has template template parameter
2024-06-27 0:31 [Bug c++/115672] New: Incorrect template type parameter deduced in non-deduced context if class template has template template parameter s.murthy at outlook dot com
` (6 preceding siblings ...)
2024-06-27 3:22 ` s.murthy at outlook dot com
@ 2024-06-28 0:19 ` s.murthy at outlook dot com
2024-06-28 0:24 ` s.murthy at outlook dot com
` (7 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: s.murthy at outlook dot com @ 2024-06-28 0:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115672
--- Comment #7 from Sean Murthy <s.murthy at outlook dot com> ---
I have three other observations I'm having a hard time grasping and worry that
I might be doing something wrong. I share them anyway in the hope they add
value. I will also attach repros for these.
The observations are made by including a new *independent* class template B
which is structurally same as class template A, except it does not have the
template template parameter.
1. "Contamination" or "bleeding" [for lack of a better word]: Create B objects
after creating A objects B objects, though of an independent class, present the
exact same issues as A objects.
2. "Dependency" of some sort where the issues with B objects disappear if A
objects are not created (though template A still exists).
3. "Order dependency", where if B objects are created *before* creating A
objects, all issues described in this bug report disappear, **including the
issues with A objects**.
I find these specific issues rather perplexing, and I hope someone will help me
understand if I'm doing something wrong here or if the compiler is in the
wrong. If the latter, I'm eager to learn the cause (eventually whenever the
issue is addressed).
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/115672] [11/12/13/14/15 Regression] Incorrect template type parameter deduced in non-deduced context if class template has template template parameter
2024-06-27 0:31 [Bug c++/115672] New: Incorrect template type parameter deduced in non-deduced context if class template has template template parameter s.murthy at outlook dot com
` (7 preceding siblings ...)
2024-06-28 0:19 ` s.murthy at outlook dot com
@ 2024-06-28 0:24 ` s.murthy at outlook dot com
2024-06-28 0:27 ` s.murthy at outlook dot com
` (6 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: s.murthy at outlook dot com @ 2024-06-28 0:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115672
--- Comment #8 from Sean Murthy <s.murthy at outlook dot com> ---
Created attachment 58536
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58536&action=edit
Repro for "contamination" or "bleeding" of A object issues to B objects
See: https://sigcpp.godbolt.org/z/73j6Yqf9b
This attachment is the repro for the "contamination" issue listed in my earlier
comment: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115672#c7
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/115672] [11/12/13/14/15 Regression] Incorrect template type parameter deduced in non-deduced context if class template has template template parameter
2024-06-27 0:31 [Bug c++/115672] New: Incorrect template type parameter deduced in non-deduced context if class template has template template parameter s.murthy at outlook dot com
` (8 preceding siblings ...)
2024-06-28 0:24 ` s.murthy at outlook dot com
@ 2024-06-28 0:27 ` s.murthy at outlook dot com
2024-06-28 0:32 ` s.murthy at outlook dot com
` (5 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: s.murthy at outlook dot com @ 2024-06-28 0:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115672
--- Comment #9 from Sean Murthy <s.murthy at outlook dot com> ---
Created attachment 58537
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58537&action=edit
Repro for "dependency" where not creating A objects fixes the issue with B
objects
See: https://sigcpp.godbolt.org/z/83xaa5ej1
This attachment is the repro for the "dependency" issue listed in my earlier
comment: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115672#c7
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/115672] [11/12/13/14/15 Regression] Incorrect template type parameter deduced in non-deduced context if class template has template template parameter
2024-06-27 0:31 [Bug c++/115672] New: Incorrect template type parameter deduced in non-deduced context if class template has template template parameter s.murthy at outlook dot com
` (9 preceding siblings ...)
2024-06-28 0:27 ` s.murthy at outlook dot com
@ 2024-06-28 0:32 ` s.murthy at outlook dot com
2024-06-28 0:34 ` s.murthy at outlook dot com
` (4 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: s.murthy at outlook dot com @ 2024-06-28 0:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115672
--- Comment #10 from Sean Murthy <s.murthy at outlook dot com> ---
Comment on attachment 58537
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58537
Repro for "dependency" where not creating A objects fixes the issue with B
objects
Oops, the last two lines of the code have incorrect end of line comment: a
copy-paste error.
static_assert(std::same_as<decltype(b2.u_), unsigned>); //passes in GCC 11.1+,
correct
static_assert(std::same_as<decltype(b2.u_), long>); //fails in GCC 11.1+,
correct
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/115672] [11/12/13/14/15 Regression] Incorrect template type parameter deduced in non-deduced context if class template has template template parameter
2024-06-27 0:31 [Bug c++/115672] New: Incorrect template type parameter deduced in non-deduced context if class template has template template parameter s.murthy at outlook dot com
` (10 preceding siblings ...)
2024-06-28 0:32 ` s.murthy at outlook dot com
@ 2024-06-28 0:34 ` s.murthy at outlook dot com
2024-07-05 13:49 ` ppalka at gcc dot gnu.org
` (3 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: s.murthy at outlook dot com @ 2024-06-28 0:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115672
--- Comment #11 from Sean Murthy <s.murthy at outlook dot com> ---
Created attachment 58538
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58538&action=edit
Repro for "order dependency" where issues with both A objects and B objects
disappear because B objects are created first
See: https://sigcpp.godbolt.org/z/K515MxWWj
This attachment is the repro for the "order dependency" issue listed in my
earlier comment: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115672#c7
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/115672] [11/12/13/14/15 Regression] Incorrect template type parameter deduced in non-deduced context if class template has template template parameter
2024-06-27 0:31 [Bug c++/115672] New: Incorrect template type parameter deduced in non-deduced context if class template has template template parameter s.murthy at outlook dot com
` (11 preceding siblings ...)
2024-06-28 0:34 ` s.murthy at outlook dot com
@ 2024-07-05 13:49 ` ppalka at gcc dot gnu.org
2024-07-05 15:27 ` ppalka at gcc dot gnu.org
` (2 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-07-05 13:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115672
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ppalka at gcc dot gnu.org
Keywords|needs-bisection |
--- Comment #12 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Started with r11-4859 as well
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/115672] [11/12/13/14/15 Regression] Incorrect template type parameter deduced in non-deduced context if class template has template template parameter
2024-06-27 0:31 [Bug c++/115672] New: Incorrect template type parameter deduced in non-deduced context if class template has template template parameter s.murthy at outlook dot com
` (12 preceding siblings ...)
2024-07-05 13:49 ` ppalka at gcc dot gnu.org
@ 2024-07-05 15:27 ` ppalka at gcc dot gnu.org
2024-07-19 13:25 ` [Bug c++/115672] [12/13/14/15 " rguenth at gcc dot gnu.org
2024-07-23 17:23 ` ppalka at gcc dot gnu.org
15 siblings, 0 replies; 17+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-07-05 15:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115672
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |ppalka at gcc dot gnu.org
Status|NEW |ASSIGNED
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/115672] [12/13/14/15 Regression] Incorrect template type parameter deduced in non-deduced context if class template has template template parameter
2024-06-27 0:31 [Bug c++/115672] New: Incorrect template type parameter deduced in non-deduced context if class template has template template parameter s.murthy at outlook dot com
` (13 preceding siblings ...)
2024-07-05 15:27 ` ppalka at gcc dot gnu.org
@ 2024-07-19 13:25 ` rguenth at gcc dot gnu.org
2024-07-23 17:23 ` ppalka at gcc dot gnu.org
15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-07-19 13:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115672
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|11.5 |12.5
--- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 11 branch is being closed.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/115672] [12/13/14/15 Regression] Incorrect template type parameter deduced in non-deduced context if class template has template template parameter
2024-06-27 0:31 [Bug c++/115672] New: Incorrect template type parameter deduced in non-deduced context if class template has template template parameter s.murthy at outlook dot com
` (14 preceding siblings ...)
2024-07-19 13:25 ` [Bug c++/115672] [12/13/14/15 " rguenth at gcc dot gnu.org
@ 2024-07-23 17:23 ` ppalka at gcc dot gnu.org
15 siblings, 0 replies; 17+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-07-23 17:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115672
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |DUPLICATE
--- Comment #14 from Patrick Palka <ppalka at gcc dot gnu.org> ---
This too is fixed on trunk by r15-2230-g2861eb34e30973, so let's also call this
one a dup of PR115656
*** This bug has been marked as a duplicate of bug 115656 ***
^ permalink raw reply [flat|nested] 17+ messages in thread