These testcases are compiling successfully since 7.1.
gcc/testsuite/ChangeLog:
PR c++/69694
* g++.dg/cpp0x/decltype74.C: New test.
* g++.dg/cpp0x/decltype75.C: New test.
+2020-03-20 Patrick Palka <ppalka@redhat.com>
+
+ PR c++/69694
+ * g++.dg/cpp0x/decltype74.C: New test.
+ * g++.dg/cpp0x/decltype75.C: New test.
+
2020-03-20 Srinath Parvathaneni <srinath.parvathaneni@arm.com>
Andre Vieira <andre.simoesdiasvieira@arm.com>
Mihail Ionescu <mihail.ionescu@arm.com>
--- /dev/null
+// PR c++/69694
+// { dg-do compile { target c++11 } }
+
+// n3911: TransformationTrait Alias `void_t`
+template<typename...> struct make_void { using type = void; };
+template<typename... Ts> using void_t = typename make_void<Ts...>::type;
+
+// std::declval<void*&>
+void*& declval_void();
+
+template<typename, typename = void> struct Fun;
+template<typename R>
+ struct Fun<R(), void>
+{
+ void fun();
+};
+template<typename Desc>
+ struct Fun<Desc, void_t<decltype (declval_void() = Desc::name)>>
+ : Fun<void()>
+{
+};
+
+struct Tag { static constexpr void* name = 0; };
+
+template<typename> void a()
+{
+ Fun<Tag>{}.fun();
+}
+
+void b() { a<int>(); }
--- /dev/null
+// PR c++/69694
+// This is a reduced version of decltype74.C.
+// { dg-do compile { target c++11 } }
+
+template<typename... Ts> using void_t = void;
+
+extern void *declval_void;
+
+template<typename, typename> struct Fun { };
+
+template<typename Desc>
+struct Fun<Desc, void_t<decltype (declval_void = Desc::name)>>
+{
+ void fun();
+};
+
+struct Tag { static constexpr void* name = 0; };
+
+template<typename> void a()
+{
+ Fun<Tag, void>{}.fun();
+}
+
+void b() { a<int>(); }