Changeset View
Changeset View
Standalone View
Standalone View
test/SemaTemplate/function-template-specialization.cpp
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | |||||
class Foo { | class Foo { | ||||
template<class T> | template<class T> | ||||
static void Bar(const T& input); | static void Bar(const T& input); | ||||
// Don't crash here. | // Don't crash here. | ||||
template<> | template<> | ||||
static void Bar(const long& input) {} // expected-error{{explicit specialization of 'Bar' in class scope}} | static void Bar(const long& input) {} // expected-error{{explicit specialization of 'Bar' in class scope}} | ||||
}; | }; | ||||
template<typename T> void f3(T) {} | |||||
extern "C" { // expected-note {{extern "C" language linkage specification begins here}} | |||||
template<> void f3(int) {} // expected-error{{templates must have C++ linkage}} | |||||
} |