Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.jason/overload12.C

raw
1 // { dg-do run }
2 // PRMS Id: 4066
3 // Bug: g++ doesn't notice the const on reference returns.
4
5 struct B {
6 int foo() { return 1; }
7 int foo() const { return 0; }
8 };
9
10 B b_;
11 const B &b () { return b_; }
12
13 int main()
14 {
15 return b().foo();
16 }