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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.oliva/] [overload1.C] - Rev 305

Compare with Previous | Blame | View Log

// { dg-do assemble  }

// Copyright (C) 1999 Free Software Foundation

// by Alexandre Oliva <oliva@lsd.ic.unicamp.br>
// Based on bug report by JDonner <jdonner@schedsys.com>

struct foo {
  static int bar(); // { dg-error "candidate" }
  void bar(int); // { dg-error "foo::bar" }
};

/* gcc emits a hard error without -pedantic, and a warning with
   -pedantic, even in bad1.  */
int (*ok1)() = foo::bar;
void (foo::*bad1)(int) = foo::bar; // { dg-error "assuming pointer" }
// { dg-message "note" "note" { target *-*-* } 16 }

int (*ok2)() = &foo::bar; // ok
void (*bad2)(int) = foo::bar; // { dg-error "no matches" }

void (foo::*ok3)(int) = &foo::bar; // ok
int (foo::*bad3)() = foo::bar; // { dg-error "no matches" }

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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