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

            Bug ID: 128342
           Summary: compiler allows invalid code where dependent template
                    name is not prefixed `template`
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: irvsrc at gmail dot com
  Target Milestone: ---

[temp.names] (4) states "when naming a template specialization of a member of
an unknown specialization ([temp.dep.type]), the member template name shall be
prefixed by the keyword template.".

However, as shown in the example below, the compiler is not enforcing this
rule:

```
template<typename b>
struct a {
    using t = typename b::c<0>; // compiles ok, however this is ill-formed
};

struct b {
    template<auto>
    struct c { };
};

auto main() -> int {
    auto v = a<b>{};
}
```

GCC (trunk), -std=c++26

Reply via email to