<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/152750>152750</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Variable template partial specializations are failing
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Warpten
      </td>
    </tr>
</table>

<pre>
    ## Current behavior

Consider the following sample:

```cpp
    template<auto Us>
    static constexpr FlagsPredicate* predicate =
        [](const config::Configuration& config) {
            // Makes it dependant, always evaluates to false
 static_assert(sizeof...(Us) < 0, "Missing implementation of a flag predicate.");
            return false;
        };

    template<bool config::FeatureFlags::* flag>
    static constexpr FlagsPredicate* predicate<flag> =
        [](const config::Configuration& config) {
 return config.featureFlags.*flag;
        };

    template<bool config::DebugFlags::* flag>
    static constexpr FlagsPredicate* predicate<flag> =
        [](const config::Configuration& config) {
 return config.debugFlags.*flag;
        };
```

Clang fails the snippet above with the following error:
```
<source>:35:38: error: variable template partial specialization does not specialize any template argument; to define the primary template, remove the template argument list
   35 | static constexpr FlagsPredicate* predicate<flag> =
      | ^        ~~~~~~
<source>:39:38: error: variable template partial specialization does not specialize any template argument; to define the primary template, remove the template argument list
   39 |     static constexpr FlagsPredicate* predicate<flag> =
      | ^        ~~~~~~
2 errors generated.
Compiler returned: 1
```

Link to compiler explorer with minimal repro case: https://godbolt.org/z/4bn6Tv3Kr

GCC 15 accepts both variations.

## Expected behavior

A parameter pack workaround should not be needed.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzUVk2P4zYM_TXKhVjDkeIkPvjg8Ux6aBfoodseC9qiHXVkSZDkzMehv72Q7fnYmRZdLOayRpAgokg9PvKJxhDUYIgqVlyx4nqDUzxbX_2B3kUym9bKh4pxwbiAZvKeTISWznhR1rO8ZnndWBOUJA_xTNBbre2dMgMEHJ0mJuplF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