https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107222

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-10-11
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |ABI, wrong-code

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Here is one which shows the issue at link time.
This should link and run.
One testcase:
```
struct A { int i; };
union Y { A a; };
constexpr Y make_y(const A a) { return {a}; }
template<auto> struct q { };
template<auto V> constexpr q<V> make_q() { return {}; }
template<auto> void print();
template<> void print<q<(Y){.a={1}}>{}>()
{
}
int main() {
  constexpr q x = make_q<make_y({1})>();
  constexpr q x1 = make_q<(Y){.a={1}}>();
  print<x>();
  print<x1>();
}
```
Another one:
```
struct A { int i; };
union Y { A a; };
constexpr Y make_y(const A a) { return {a}; }
template<auto> struct q { };
template<auto V> constexpr q<V> make_q() { return {}; }
void print(q<(Y){.a={1}}> a)
{

}
void print(...);
int main() {
  constexpr q x = make_q<make_y({1})>();
  constexpr q x1 = make_q<(Y){.a={1}}>();
  print(x);
  print(x1);
}
```
clang mangles both x and x1 the same ...

Reply via email to