| 1 |
// { dg-do assemble } |
| 2 |
// { dg-options "-pedantic-errors" } |
| 3 |
|
| 4 |
class Base { |
| 5 |
public: |
| 6 |
int foo; |
| 7 |
}; |
| 8 |
|
| 9 |
class Derived : public Base { |
| 10 |
public: |
| 11 |
int bar; |
| 12 |
}; |
| 13 |
|
| 14 |
void func(Base&); // { dg-message "argument 1" } |
| 15 |
|
| 16 |
void func2(const Derived& d) { |
| 17 |
func(d); // { dg-error "" } |
| 18 |
} |
| 19 |
|
| 20 |
void |
| 21 |
foo (int& a) // { dg-message "argument 1" } |
| 22 |
{ |
| 23 |
} |
| 24 |
|
| 25 |
int main () |
| 26 |
{ |
| 27 |
int b; |
| 28 |
const int*const a = &b; |
| 29 |
*a = 10; // { dg-error "read-only location" } |
| 30 |
foo (*a); // { dg-error "qualifiers" } |
| 31 |
return 0; |
| 32 |
} |