aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype39.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype39.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype39.C19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype39.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype39.C
new file mode 100644
index 000000000..4676d2de9
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/decltype39.C
@@ -0,0 +1,19 @@
+// PR c++/53788
+// { dg-do compile { target c++11 } }
+
+struct t { static const bool value = true; };
+struct f { static const bool value = false; };
+
+template<typename T>
+struct has_static {
+ template<typename X>
+ static t check(X*, decltype(T::fun())* = 0); // { dg-error "without object" }
+ static f check(...);
+
+ typedef decltype(check((T*)(0))) ret;
+ static const bool value = ret::value;
+};
+
+struct test { int fun() { return 0; } };
+
+bool b = has_static<test>::value;