aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/error4.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/error4.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/error4.C22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/error4.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/error4.C
new file mode 100644
index 0000000..bd73b2a
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/error4.C
@@ -0,0 +1,22 @@
+// PR c++/49156
+// { dg-do compile { target c++11 } }
+
+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(...); // { dg-error "operator*" }
+
+ typedef decltype(get<T>(declval<T>())) type; // { dg-error "no match" }
+};
+
+struct X { };
+
+S<X>::type x;
+
+// { dg-prune-output "note" }