http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48525

Dmitry Gorbachev <d.g.gorbachev at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |d.g.gorbachev at gmail dot
                   |                            |com

--- Comment #4 from Dmitry Gorbachev <d.g.gorbachev at gmail dot com> 
2011-04-09 21:08:05 UTC ---
> Would it not be prudent for g++ to at least emit a
> warning when the ODR is violated in cases like this?

Gold (a linker) can detect such cases:

$ g++ main.cpp double.cpp square.cpp -Wall -O0  -g -Wl,--detect-odr-violations
/usr/local/bin/ld: warning: while linking a.out: symbol 'sharedname(int)'
defined in multiple places (possible ODR violation):
  square.cpp:2 from /tmp/ccwt9DKt.o
  double.cpp:2 from /tmp/ccb8pMLx.o

Reply via email to