OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [other/] [ptrmem2.C] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
 
3
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
4
// Contributed by Nathan Sidwell 31 Dec 2001 
5
 
6
// PR 4379. We created pointers to member references and pointers to
7
// member fields when we shouldn't have.
8
 
9
struct D {
10
 
11
  int &m;       // { dg-error "invalid use of non-static data member" "" }
12
  static int &s;
13
 
14
  int Foo ();
15
};
16
 
17
template int f1(T x);
18
template int f2(T x);
19
 
20
int D::Foo ()
21
{
22
  f1( &D::m);   // { dg-error "cannot create pointer to ref" "" }
23
  f1( &(D::m)); // ok
24
  f2( &D::s);   // ok
25
  f2( &(D::s)); // ok
26
  return 0;
27
}
28
 
29
int Foo ()
30
{
31
  f1( &D::m);    // { dg-error "cannot create pointer to ref" "" }
32
  f1( &(D::m));  // { dg-error "from this location" "" }
33
  f2( &D::s);    // ok
34
  f2( &(D::s));  // ok
35
  return 0;
36
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.