[Bug c++/92986] New: ODR violation not detected

2019-12-18 Thread geeteshmore at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: geeteshmore at gmail dot com Target Milestone: --- Hi, I've a testcase where a class with same name is called in multiple files. However, depending on the order of compile, output is different. Compiler is unable to detect the One Defin

[Bug c++/92986] ODR violation not detected

2019-12-18 Thread geeteshmore at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92986 --- Comment #2 from Geetesh More --- But compiler should be throwing some message/warning about declaration of same class in multiple files. This is common scenario in cases where a class is copied in multiple files.

[Bug c++/92986] ODR violation not detected

2019-12-18 Thread geeteshmore at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92986 --- Comment #4 from Geetesh More --- I tried with -flto, but I'm not seeing any warning messages: g++ -std=c++0x -g -flto -Wodr main.cpp file2.cpp Am I missing anything here?