summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/oper1.C
blob: 7f97d73a8f5710a52e8b2a1fed0aa60d1d07d014 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// { 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);
}