URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc3/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [cast4.C] - Rev 305
Go to most recent revision | Compare with Previous | Blame | View Log
// { dg-do assemble }
// Copyright (C) 2000 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 3 Jan 2000 <nathan@acm.org>
// Derived from a bug report by Ulrich Drepper <drepper@cygnus.com>
struct A {operator char * () { return 0;} };
struct B {operator char * () const { return 0;} };
struct C {operator char const * () { return 0;} };
struct D {operator char const * () const { return 0;} };
void f0 ()
{
A a = A ();
B b = B ();
C c = C ();
D d = D ();
static_cast <char *> (a);
static_cast <char *> (b);
static_cast <char *> (c); // { dg-error "" } static cast
static_cast <char *> (d); // { dg-error "" } static cast
}
void f1 ()
{
A a = A ();
B b = B ();
C c = C ();
D d = D ();
static_cast <const char *> (a);
static_cast <const char *> (b);
static_cast <const char *> (c);
static_cast <const char *> (d);
}
void f2 ()
{
A const a = A ();
B const b = B ();
C const c = C ();
D const d = D ();
static_cast <char *> (a); // { dg-error "" } static cast
static_cast <char *> (b);
static_cast <char *> (c); // { dg-error "" } static cast
static_cast <char *> (d); // { dg-error "" } static cast
}
void f3 ()
{
A const a = A ();
B const b = B ();
C const c = C ();
D const d = D ();
static_cast <const char *> (a); // { dg-error "" } static cast
static_cast <const char *> (b);
static_cast <const char *> (c); // { dg-error "" } static cast
static_cast <const char *> (d);
}
Go to most recent revision | Compare with Previous | Blame | View Log