23 lines · cpp
1// RUN: %clang_cc1 -fms-compatibility -fsyntax-only -verify %s2// RUN: %clang_cc1 -fms-compatibility -fsyntax-only -fms-compatibility-version=12.0 -verify %s3 4struct C {5 template <typename T> static int foo(T);6};7 8template <typename T> static int C::foo(T) { 9 //expected-warning@-1 {{'static' can only be specified inside the class definition}}10 return 0;11}12 13template <class T> struct S { 14 void f();15};16 17template <class T> static void S<T>::f() {}18#if _MSC_VER >= 190019 //expected-error@-2 {{'static' can only be specified inside the class definition}}20#else21 //expected-warning@-4 {{'static' can only be specified inside the class definition}}22#endif23