111
|
1 // PR c++/37967
|
|
2 // Negative test for auto
|
|
3 // { dg-do compile { target c++11 } }
|
|
4
|
|
5 auto f1 () -> int;
|
145
|
6 auto f2 (); // { dg-error "1:.f2. function uses .auto. type specifier without trailing return type" "" { target { ! c++14 } } }
|
|
7 int f3 () -> int; // { dg-error "1:.f3. function with trailing return type" }
|
|
8 auto *f4 () -> int; // { dg-error "1:.f4. function with trailing return type" }
|
111
|
9
|
|
10 struct A
|
|
11 {
|
|
12 auto f5 () const -> int;
|
145
|
13 auto f6 (); // { dg-error "3:.f6. function uses .auto. type specifier without trailing return type" "" { target { ! c++14 } } }
|
|
14 int f7 () -> int; // { dg-error "3:.f7. function with trailing return type" }
|
|
15 auto *f8 () -> int; // { dg-error "3:.f8. function with trailing return type" }
|
111
|
16 };
|