summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/other/const1.C
blob: f010138378f4b0f2ea6ce04fbed73285e75c7ead (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// { dg-do compile }

// Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 26 Dec 2001 <nathan@nathan@codesourcery.com>

// PR 335. Missed diagnostic

struct Foo
{
  unsigned i;
  void Modify(unsigned j) const;
};

void Foo::Modify(unsigned j) const
{
  Foo::i = j;  // { dg-error "assignment of member" "" }
}