summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.benjamin/15799.C
blob: 24725c999b0f08f5d6df1cb154f3b04245bf76e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// { dg-do assemble  }
// 981203 bkoz
// g++/15799  test1

/* 
15799.cpp: In function `void foo()':
15799.cpp:21: call of overloaded `sanjose({anonymous enum})' is ambiguous
15799.cpp:13: candidates are: sanjose::sanjose(const sanjose &) <near match>
15799.cpp:14:                 sanjose::sanjose(unsigned int)
*/

typedef char int_8;
typedef unsigned long uint_32;

class sanjose {
public:
   sanjose();
   sanjose(const sanjose&);  // { dg-message "note" }
   sanjose(int_8 value);  // { dg-message "note" }
   sanjose(uint_32 value);  // { dg-message "note" }
};

enum { first, last};

void foo(void) {
  sanjose obj(first); // { dg-error "ambiguous" }
  // { dg-message "candidate" "candidate note" { target *-*-* } 26 }
}