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

            Bug ID: 125575
           Summary: explicit instantiation of variable template misses
                    type check
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

```
template<typename T>
constexpr int vt = 42;

template int vt<int>;
```

is accepted but all the other compilers reject this:

error: type 'int' of explicit instantiation of 'vt' does not match expected
type 'const int'
    4 | template int vt<int>;
      |          ^

Even this is accepted:

```
template<typename T>
constexpr int vt = 42;

template float vt<int>;
```

Reply via email to