https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119034
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Last reconfirmed| |2025-02-27
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is odd, doing this:
```
namespace foo
{
struct X { };
void func(X) { }
}
namespace bar
{
int func() = delete;
template<typename T>
using type = decltype(func(T{})); // #2
}
template<typename, typename> constexpr bool is_same_v = false;
template<typename T> constexpr bool is_same_v<T, T> = true;
static_assert( is_same_v<bar::type<foo::X>, void> );
```
Works but if you add:
```
template<bool>
struct result
{
template<typename T>
using type1 = type<T>; // #2
};
```
After the type alias, GCC fails. even if result<arg>::type1 is unused.
That is this fails:
```
namespace foo
{
struct X { };
void func(X) { }
}
namespace bar
{
int func() = delete;
template<typename T>
using type = decltype(func(T{})); // #2
template<bool>
struct result
{
template<typename T>
using type1 = type<T>; // #2
};
}
template<typename, typename> constexpr bool is_same_v = false;
template<typename T> constexpr bool is_same_v<T, T> = true;
static_assert( is_same_v<bar::type<foo::X>, void> );
```