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

            Bug ID: 117454
           Summary: Template parameter hidden by base class name
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Darrell.Wright at gmail dot com
  Target Milestone: ---

There should be a warning when a template parameter name is hidden by a base
classes usage of it.  e.g

```
struct Base {
        int Value = 42;
};

template <auto Value>
struct Derived : Base {
    int v = Value;
};

static_assert( Derived<66>{}.v == 66 );
```
Will fail to compile, the intent is clear.  This happens with any name it seems

```
#include <type_traits>

struct Base {
    using Type = int;
};

template <typename Type>
struct Derived : Base {
    Type field;
};

static_assert( std::is_same_v<decltype(Derived<double>{}.field), double> );
```

However, if the Base is a dependent type the behaviour is reversed.  The user
fix is to change the template param name, but I think compilers should have a
warning for this here as the code is probably broken

Reply via email to