Files
clang-p2996/clang/test/SemaCXX/invalid-template-declaration.cpp
Braden Helmer ef7d46c7e6 Template Diagnostic Improvements (#99933)
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.
2024-07-23 13:31:49 +02:00

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}}
};