comparison gcc/testsuite/g++.old-deja/g++.other/decl6.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
9 { 9 {
10 friend explicit int j(); // { dg-error "" } only ctor decls can be explicit 10 friend explicit int j(); // { dg-error "" } only ctor decls can be explicit
11 friend explicit B::B (); // { dg-error "" } only ctor decls can be explicit 11 friend explicit B::B (); // { dg-error "" } only ctor decls can be explicit
12 int f(const); // { dg-error "" } ansi forbids no type 12 int f(const); // { dg-error "" } ansi forbids no type
13 const k; // { dg-error "" } ansi forbids no type 13 const k; // { dg-error "" } ansi forbids no type
14 mutable friend int j1 (); // { dg-error "" } non-member cannot be mutable 14 mutable friend int j1 (); // { dg-error "3:storage class specifiers" } non-member cannot be mutable
15 mutable typedef int d; // { dg-error "" } non-object cannot be mutable 15 mutable typedef int d; // { dg-error "" } non-object cannot be mutable
16 mutable int fn (); // { dg-error "" } non-object cannot be mutable 16 mutable int fn (); // { dg-error "3:function .fn. cannot be declared .mutable." } non-object cannot be mutable
17 void fn (mutable int); // { dg-error "" } non-member cannot be mutable 17 void fn (mutable int); // { dg-error "12:non-member .parameter. cannot be declared .mutable." } non-member cannot be mutable
18 mutable static int s; // { dg-error "" } static cannot be mutable 18 mutable static int s; // { dg-error "" } static cannot be mutable
19 mutable const int s1; // { dg-error "" } const cannot be mutable 19 mutable const int s1; // { dg-error "3:.const. .s1. cannot be declared .mutable." } const cannot be mutable
20 mutable const int *s2; // ok 20 mutable const int *s2; // ok
21 mutable int *const s3; // { dg-error "" } const cannot be mutable 21 mutable int *const s3; // { dg-error "3:.const. .s3. cannot be declared .mutable." } const cannot be mutable
22 explicit A (); // ok 22 explicit A (); // ok
23 }; 23 };
24 mutable int g; // { dg-error "" } non-member cannot be mutable 24 mutable int g; // { dg-error "1:non-member .g. cannot be declared .mutable." } non-member cannot be mutable
25 explicit A::A () {} // { dg-error "" } only ctor decls can be explicit 25 explicit A::A () {} // { dg-error "" } only ctor decls can be explicit
26 26