opnsense-src/test/SemaCXX/decltype-overloaded-functions.cpp

13 lines
453 B
C++
Raw Normal View History

2010-01-01 05:34:51 -05:00
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++0x
2009-07-04 09:58:54 -04:00
void f();
void f(int);
2010-01-01 05:34:51 -05:00
decltype(f) a; // expected-error{{cannot determine the declared type of an overloaded function}}
2009-07-04 09:58:54 -04:00
template<typename T> struct S {
2010-01-01 05:34:51 -05:00
decltype(T::f) * f; // expected-error{{cannot determine the declared type of an overloaded function}}
2009-07-04 09:58:54 -04:00
};
struct K { void f(); void f(int); };
S<K> b; // expected-note{{in instantiation of template class 'struct S<struct K>' requested here}}