view gcc/testsuite/g++.old-deja/g++.jason/overload12.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

// { dg-do run  }
// PRMS Id: 4066
// Bug: g++ doesn't notice the const on reference returns.

struct B {
  int foo() { return 1; }
  int foo() const { return 0; }
};

B b_;
const B &b () { return b_; }

int main()
{
  return b().foo();
}