view gcc/testsuite/g++.dg/ext/oper1.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 }

// Copyright 2002 Free Software Foundation
// Contributed by Jason Merrill <jason@redhat.com>

// Make sure the GNU extension of accepting dropping cv-qualifiers for
// the implicit this argument does not kick in when taking the address
// of an object, since this extension would change the meaning of a
// well-defined program.

struct A {
  A* operator&() { return 0; }
};

int main ()
{
  const A a = {};
  return (&a == 0);
}