aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/decltype-overloaded-functions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/decltype-overloaded-functions.cpp')
-rw-r--r--test/SemaCXX/decltype-overloaded-functions.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/SemaCXX/decltype-overloaded-functions.cpp b/test/SemaCXX/decltype-overloaded-functions.cpp
new file mode 100644
index 0000000000..4c5349b858
--- /dev/null
+++ b/test/SemaCXX/decltype-overloaded-functions.cpp
@@ -0,0 +1,12 @@
+// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x
+
+void f();
+void f(int);
+decltype(f) a; // expected-error{{can't determine the declared type of an overloaded function}}
+
+template<typename T> struct S {
+ decltype(T::f) * f; // expected-error{{can't determine the declared type of an overloaded function}}
+};
+
+struct K { void f(); void f(int); };
+S<K> b; // expected-note{{in instantiation of template class 'struct S<struct K>' requested here}}