https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103347
Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |mpolacek at gcc dot gnu.org --- Comment #9 from Marek Polacek <mpolacek at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #8) > And grokdeclarator isn't called with the actual initializer (DEFERRED_PARSE) > from which we could dig up the location of the first token. True, though cp_parser_member_declaration has initializer_token_start which carries the location of the '='. I suppose we could add another location_t to cp_declarator for init-declarators, and then just use it. For which I have a patch: $ ./cc1plus -quiet 103347.C -std=c++03 103347.C:3:13: warning: non-static data member initializers only available with ‘-std=c++11’ or ‘-std=gnu++11’ [-Wc++11-extensions] 3 | void *x = NULL; //invalid in C++03 mode | ^