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

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
comparison
equal deleted inserted replaced
145:1830386684a0 152:2b5abeee2509
1 // PR c++/94326
2 // { dg-do compile { target c++11 } }
3 // { dg-options "-fcompare-debug" }
4
5 template <typename = int> struct A {
6 const int &foo() { return 0; } // { dg-warning "returning reference to temporary" }
7 template <typename _Kt> void bar(_Kt) { foo(); }
8 };
9 struct B {
10 A<> b;
11 template <typename _Kt> auto baz(_Kt p1) -> decltype(b.bar(p1)) {
12 b.bar(p1);
13 }
14 };
15 struct C {};
16 void operator<(C, int) {
17 B a;
18 a.baz(C{});
19 }