It turns out `SemaTemplate` handles this type of diagnostic already, however when template gets encountered, it never gets parsed as a possible statement or declaration, only as an expression. Fixes #17959.
7 lines
181 B
C++
7 lines
181 B
C++
// RUN: %clang_cc1 %s -verify -fsyntax-only
|
|
// PR99933
|
|
|
|
struct S {
|
|
template <typename> int i; // expected-error {{non-static data member 'i' cannot be declared as a template}}
|
|
};
|