"error: identifier 'line' after '~' in destructor name does not name a type" in struct line that has line member #88597
Open
Description
#include <string_view>
struct line {
std::string_view line;
~line() {
line = {};
}
};trunk returns
<source>:5:3: error: identifier 'line' after '~' in destructor name does not name a type
cmd/join.cpp:49:5: error: identifier 'line' after '~' in destructor name does not name a type
49 | ~line() {
| ^~~~
| line
cmd/join.cpp:32:21: note: non-type declaration found by destructor name lookup
32 | std::string_view line;
| ^
older versions return
<source>:5:3: error: expected the class name after '~' to name a destructor
All GCC versions accept this.
Don't particularly see why the member would factor into the lookup at all here, but it's not like I can call this ~(struct line)() { or ~struct line() {.
Activity