https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88175

            Bug ID: 88175
           Summary: Showing header file instead of source code line in
                    error
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jg at jguk dot org
  Target Milestone: ---

Also reproduced in g++ 8

$ g++ -O2 -Werror=uninitialized -o header header.cpp
In file included from header.cpp:5:0:
header.h: In function ‘void test(info_t)’:
header.h:8:16: error: ‘copy.info::registered’ is used uninitialized in this
function [-Werror=uninitialized]
 typedef struct info
                ^~~~
header.h: In function ‘int main()’:
header.h:8:16: error: ‘temp.info::registered’ is used uninitialized in this
function [-Werror=uninitialized]
 typedef struct info
                ^~~~
cc1plus: some warnings being treated as errors


Expected it to show the following
==================================

$ g++ -O2 -Werror=uninitialized -o header header.cpp
header.cpp: In function ‘void test(info_t)’:
header.cpp:10:10: error: ‘copy’ is used uninitialized in this function
[-Werror=uninitialized]
     temp = copy;
     ~~~~~^~~~~~
cc1plus: some warnings being treated as errors

Reply via email to