xref: /llvm-project/clang/test/SemaCXX/identical-type-primary-partial-specialization.cpp (revision eaee8aa0afe111f9291d54ecef97a3640a0f6ce0)
1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++17 %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s
3 
4 template <decltype(auto) a>
5 struct S { // expected-note {{previous definition is here}}
6     static constexpr int i = 42;
7 };
8 
9 template <decltype(auto) a>
10 struct S<a> { // expected-error {{class template partial specialization does not specialize any template argument; to define the primary template, remove the template argument list}} \
11               // expected-error {{redefinition of 'S'}}
12     static constexpr int i = 0;
13 };
14