https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69145
Bug ID: 69145 Summary: [6 Regression] Bogus 'warning: #pragma implementation for ‘...’ appears after file is included' Product: gcc Version: 6.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org CC: dmalcolm at gcc dot gnu.org Target Milestone: --- Created attachment 37224 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37224&action=edit Patch used to show the "note" line Since a while, I get seemingly bogus warnings of the form: file.cc:38:24: warning: #pragma implementation for ‘header.h’ appears after file is included The warning is generated in gcc/cp/lex.c's handle_pragma_implementation and calls cpp_included_before, which contains: while (entry && (entry->start_dir == NULL || entry->u.file->err_no || entry->location > location)) entry = entry->next; I modified the code to print a "note" with the entry->location after the warning call. Example: TDICmds.cc:7:24: warning: #pragma implementation for ‘create_defect_script_SCDBase.cc’ appears after file is included #pragma implementation "create_defect_script_SCDBase.cc" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from TDICmds.cc:33:0: ./create_defect_script_SCDBase.cc:1:0: note: File was included here #include "create_defect_script_SCDBase.h" I will now try to create a small example and to find the commit, which caused the regression.