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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do assemble  }
2
// GROUPS passed ARM-compliance
3
#include        
4
enum f1 {
5
     F1
6
};
7
 
8
enum f2 {
9
    F2
10
};
11
 
12
class A {
13
public:
14
    void set (f1 f);
15
};
16
void A::set (f1 f) { std::cout << "called A f1\n";}
17
 
18
class B : public A {
19
public:
20
    void set (f2 f);
21
};
22
void B::set (f2 f) { std::cout << "called B\n|no known conversion";} // { dg-message "B::set|no known conversion" }
23
 
24
int main() {
25
    B b;
26
    b.set(F1); // ARM page 309: should call A.set(f1) and that what g++ does,// { dg-error "match" }
27
    // { dg-message "candidate" "candidate note" { target *-*-* } 26 }
28
               // but 13.1 of ARM clearly states that it should call B::set()
29
               // or generate an error because overloading works only for
30
               // functions within the same scope (first page of chapter 13)
31
               // while member of derived and base classes are considered to
32
               // belong to different scopes.  Thus B::set() should have
33
               // hidden (completely) the A::set() function.
34
}
35
 
36
 
37
 
38
 
39
 

powered by: WebSVN 2.1.0

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