diff gcc/testsuite/g++.dg/other/pr94326.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/testsuite/g++.dg/other/pr94326.C	Mon May 25 07:50:57 2020 +0900
@@ -0,0 +1,19 @@
+// PR c++/94326
+// { dg-do compile { target c++11 } }
+// { dg-options "-fcompare-debug" }
+
+template <typename = int> struct A {
+  const int &foo() { return 0; }	// { dg-warning "returning reference to temporary" }
+  template <typename _Kt> void bar(_Kt) { foo(); }
+};
+struct B {
+  A<> b;
+  template <typename _Kt> auto baz(_Kt p1) -> decltype(b.bar(p1)) {
+    b.bar(p1);
+  }
+};
+struct C {};
+void operator<(C, int) {
+  B a;
+  a.baz(C{});
+}