+++ This bug was initially created as a clone of Bug #78693 +++ Multiple unresolved unclear issues from the above PR: struct A { auto foo(), bar(); }; auto A::foo() { return 1; } auto A::bar() { return 2; } Is this valid or not? Both g++ and clang++ accept it. [dcl.spec.auto]/7 says only: "If the init-declarator-list contains more than one init-declarator, they shall all form declarations of variables." which presumably doesn't apply to analogical member-declarator-list and member-declarator, but should it? Another similar testcase: struct B { static auto const a = 5, foo(), bar(); }; auto const B::foo() { return 1; } auto const B::bar() { return 2; } Another issue: struct C { static auto const a = 5, b = 6L; }; clang++ rejects this, g++ doesn't: pr78693-5.C:3:10: error: 'auto' deduced as 'int' in declaration of 'a' and deduced as 'long' in declaration of 'b' static auto const a = 5, b = 6L; The question is if [dcl.spec.auto]/7 further sentence: "The type of each declared variable is determined by placeholder type deduction (7.1.7.4.1), and if the type that replaces the placeholder type is not the same in each deduction, the program is ill-formed." applies just to the init-declarator-list or also to member-declarator-list. Consistency and common sense would suggest that we should reject it like clang++ does, does the C++ standard need to be changed for that though?
Confirmed, although changing from rejects-valid to accepts-invalid since g++ accepts all of the examples without printing any diagnostics.
cc-ing diagnostics maintainers