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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.pt/] [ptrmem10.C] - Blame information for rev 699

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do assemble  }
2
//
3
// Copyright (C) 2000 Free Software Foundation, Inc.
4
// Contributed by Nathan Sidwell 14 Aug 2000 
5
 
6
// A pointer to member can only be formed by `&T::m', however, other forms
7
// are ok for pointer to static member. Thus the error can only be determined
8
// after overload resolution. In template deduction, this can disambiguate
9
// otherwise ambiguous cases.
10
 
11
struct A
12
{
13
  static int f (int);
14
  int f (short);
15
  void baz ();
16
};
17
 
18
template  void foo (int (*)(T));      // { dg-message "note" }
19
template  void foo (int (A::*)(T));   // { dg-message "note" } candidate
20
 
21
 
22
void A::baz ()
23
{
24
  foo (&A::f);  // { dg-error "ambiguous" }
25
  // { dg-message "candidate" "candidate note" { target *-*-* } 24 }
26
  foo (A::f);
27
  foo (&(A::f));
28
  foo (f);
29
  foo (&f);
30
}

powered by: WebSVN 2.1.0

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