Closed
Description
version 17.0.1 correctly formats this:
// --dump-config has
// AttributeMacros:
// - _COLD
#define _COLD __attribute__((cold))
class C {
public:
__attribute__((cold)) C() : Base(obj->func()) {} // OK
_COLD C() : Base(obj->func()) {} // OK
C() : Base(obj->func()) {} // OK
};
whereas 18.1 and HEAD (d99cfa0) incorrectly think ->
is introducing a trailing return type when the constructor has an attribute attached to it:
// --dump-config has
// AttributeMacros:
// - _COLD
#define _COLD __attribute__((cold))
class C {
public:
__attribute__((cold)) C() : Base(obj -> func()) {} // WRONG
_COLD C() : Base(obj -> func()) {} // WRONG
C() : Base(obj->func()) {} // OK
};