blob: bf3f18be20ded676a872aae6fe343ddb81195c5f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
// { dg-do compile { target c++11 } }
struct A {};
// We shouldn't arbitarily choose which of these is better.
void f (A&);
void f (const A&&);
// But do prefer the lvalue overload here.
void g (A&);
void g (A&&);
int main()
{
const A a;
f(a); // { dg-error "no match" }
// { dg-error "qualifiers" "" { target *-*-* } .-1 }
// { dg-error "lvalue" "" { target *-*-* } .-2 }
g(a); // { dg-error "qualifiers" }
}
|