[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaCXX / warn-static-outside-class-definition.cpp
blob9a3f96b7729b94645e042699e4fd17e90b5c424d
1 // RUN: %clang_cc1 -fms-compatibility -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -fms-compatibility -fsyntax-only -fms-compatibility-version=12.0 -verify %s
4 struct C {
5 template <typename T> static int foo(T);
6 };
8 template <typename T> static int C::foo(T) {
9 //expected-warning@-1 {{'static' can only be specified inside the class definition}}
10 return 0;
13 template <class T> struct S {
14 void f();
17 template <class T> static void S<T>::f() {}
18 #if _MSC_VER >= 1900
19 //expected-error@-2 {{'static' can only be specified inside the class definition}}
20 #else
21 //expected-warning@-4 {{'static' can only be specified inside the class definition}}
22 #endif