URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
// { dg-do compile }
|
// { dg-do compile }
|
|
|
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
// Contributed by Nathan Sidwell 31 Dec 2001
|
// Contributed by Nathan Sidwell 31 Dec 2001
|
|
|
// PR 4379. We created pointers to member references and pointers to
|
// PR 4379. We created pointers to member references and pointers to
|
// member fields when we shouldn't have.
|
// member fields when we shouldn't have.
|
|
|
struct D {
|
struct D {
|
|
|
int &m; // { dg-error "invalid use of non-static data member" "" }
|
int &m; // { dg-error "invalid use of non-static data member" "" }
|
static int &s;
|
static int &s;
|
|
|
int Foo ();
|
int Foo ();
|
};
|
};
|
|
|
template int f1(T x);
|
template int f1(T x);
|
template int f2(T x);
|
template int f2(T x);
|
|
|
int D::Foo ()
|
int D::Foo ()
|
{
|
{
|
f1( &D::m); // { dg-error "cannot create pointer to ref" "" }
|
f1( &D::m); // { dg-error "cannot create pointer to ref" "" }
|
f1( &(D::m)); // ok
|
f1( &(D::m)); // ok
|
f2( &D::s); // ok
|
f2( &D::s); // ok
|
f2( &(D::s)); // ok
|
f2( &(D::s)); // ok
|
return 0;
|
return 0;
|
}
|
}
|
|
|
int Foo ()
|
int Foo ()
|
{
|
{
|
f1( &D::m); // { dg-error "cannot create pointer to ref" "" }
|
f1( &D::m); // { dg-error "cannot create pointer to ref" "" }
|
f1( &(D::m)); // { dg-error "from this location" "" }
|
f1( &(D::m)); // { dg-error "from this location" "" }
|
f2( &D::s); // ok
|
f2( &D::s); // ok
|
f2( &(D::s)); // ok
|
f2( &(D::s)); // ok
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.