Bug 94152 - Mistyped destructor name diagnostic suboptimal
Summary: Mistyped destructor name diagnostic suboptimal
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 10.0
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2020-03-12 10:34 UTC by Richard Biener
Modified: 2020-03-13 04:15 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2020-03-12 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Biener 2020-03-12 10:34:11 UTC
struct _X { ~_X(); };
_X::~X () {}

produces

t.C:2:8: error: expected class-name before ‘(’ token
 _X::~X () {}
        ^

where clang says

t.C:2:6: error: expected the class name after '~' to name a destructor
_X::~X () {}
     ^
     _X

which is clearly better.