summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/sfinae55.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/sfinae55.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/sfinae55.C33
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/sfinae55.C b/gcc/testsuite/g++.dg/cpp0x/sfinae55.C
new file mode 100644
index 0000000000..7b6557ee7d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/sfinae55.C
@@ -0,0 +1,33 @@
+// PR c++/64970
+// { dg-do compile { target c++11 } }
+
+template<typename T>
+T && declval();
+
+template<typename T>
+struct void_ { using type = void; };
+
+template<typename T>
+using void_t = typename void_<T>::type;
+
+template<class A, class B>
+struct Outer
+{
+ template<class C, class D>
+ using Inner = decltype(true ? declval<C>() : declval<D>());
+};
+
+template<class A, class B, typename Enable = void>
+struct S
+{};
+
+template<class A, class B>
+struct S<A, B, void_t<typename Outer<A, B>::template Inner<A, B>>>
+{};
+
+struct A{};
+struct B{};
+int main()
+{
+ S<A, B> s;
+}