summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/error4.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/error4.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/error4.C22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/error4.C b/gcc/testsuite/g++.dg/cpp0x/error4.C
new file mode 100644
index 000000000..29a1cddab
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/error4.C
@@ -0,0 +1,22 @@
+// PR c++/49156
+// { dg-options -std=c++0x }
+
+template<typename T> T declval();
+
+template<typename T>
+struct S {
+
+ template<typename U>
+ static U get(const volatile T&);
+
+ template<typename U>
+ static decltype(*declval<U>()) get(...);
+
+ typedef decltype(get<T>(declval<T>())) type; // { dg-error "no match" }
+};
+
+struct X { };
+
+S<X>::type x;
+
+// { dg-prune-output "note" }