https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120626
Bug ID: 120626
Summary: Wrong type generation with non-type template arguments
Product: gcc
Version: 15.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: arbmind at gmail dot com
Target Milestone: ---
Created attachment 61619
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61619&action=edit
Code to reproduce
GCC seems to generate wrong types for non-trivial type generations.
When GCC generated a type with the same amount of pack members and the same
value the type of the non-type template arguments seems to be irrelevant and
the wrong type is generated.
I got this when I tried to build a unit system `UnitValue<Volt{1}>` and started
implementing unit folding `V*A => W`, `V/A => Ohm` etc. CLANG and MSVC get this
right, but GCC seems to get this wrong for all versions. The code runs with GCC
10.1 up to GCC trunk on Godbolt. - https://gcc_bug.godbolt.org/z/PT145WMxv