https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66180
--- Comment #5 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- For example: % cat foo1.cpp #include <memory> namespace { class A { int i; }; } class G { std::unique_ptr<A> foo() const; }; std::unique_ptr<A> G::foo() const { return std::make_unique<A>(); } % cat foo2.cpp #include <memory> namespace { class A { bool a; }; } class H { std::unique_ptr<A> bar() const; }; std::unique_ptr<A> H::bar() const { return std::make_unique<A>(); } % g++ -flto -shared -std=c++14 foo1.cpp foo2.cpp /home/trippels/gcc_6/usr/local/include/c++/6.0.0/tuple:102:12: warning: type ‘struct _Head_base’ violates one definition rule [-Wodr] struct _Head_base<_Idx, _Head, false> ^ /home/trippels/gcc_6/usr/local/include/c++/6.0.0/tuple:102:12: note: a different type is defined in another translation unit struct _Head_base<_Idx, _Head, false> ^ /home/trippels/gcc_6/usr/local/include/c++/6.0.0/tuple:147:13: note: the first difference of corresponding definitions is field ‘_M_head_impl’ _Head _M_head_impl; ^ /home/trippels/gcc_6/usr/local/include/c++/6.0.0/tuple:147:13: note: a field of same name but different type is defined in another translation unit _Head _M_head_impl; ^ foo1.cpp:3:7: note: type ‘struct A’ defined in anonymous namespace can not match type ‘struct A’ class A { ^ foo2.cpp:3:7: note: the incompatible type defined in anonymous namespace in another translation unit class A { ^ /home/trippels/gcc_6/usr/local/include/c++/6.0.0/tuple:180:12: warning: type ‘struct _Tuple_impl’ violates one definition rule [-Wodr] struct _Tuple_impl<_Idx, _Head, _Tail...> ^ /home/trippels/gcc_6/usr/local/include/c++/6.0.0/tuple:180:12: note: a type with different bases is defined in another translation unit struct _Tuple_impl<_Idx, _Head, _Tail...> ^ /home/trippels/gcc_6/usr/local/include/c++/6.0.0/tuple:596:11: warning: type ‘struct tuple’ violates one definition rule [-Wodr] class tuple<_T1, _T2> : public _Tuple_impl<0, _T1, _T2> ^ /home/trippels/gcc_6/usr/local/include/c++/6.0.0/tuple:596:11: note: a type with different bases is defined in another translation unit class tuple<_T1, _T2> : public _Tuple_impl<0, _T1, _T2> ^ /home/trippels/gcc_6/usr/local/include/c++/6.0.0/bits/unique_ptr.h:129:11: warning: type ‘struct unique_ptr’ violates one definition rule [-Wodr] class unique_ptr ^ /home/trippels/gcc_6/usr/local/include/c++/6.0.0/bits/unique_ptr.h:129:11: note: a different type is defined in another translation unit class unique_ptr ^ /home/trippels/gcc_6/usr/local/include/c++/6.0.0/bits/unique_ptr.h:147:57: note: the first difference of corresponding definitions is field ‘_M_t’ __tuple_type _M_t; ^ /home/trippels/gcc_6/usr/local/include/c++/6.0.0/bits/unique_ptr.h:147:57: note: a field of same name but different type is defined in another translation unit __tuple_type _M_t; ^ /home/trippels/gcc_6/usr/local/include/c++/6.0.0/bits/unique_ptr.h:146:57: note: type ‘struct __tuple_type’ should match type ‘struct __tuple_type’ that itself violate one definition rule typedef std::tuple<typename _Pointer::type, _Dp> __tuple_type; ^ /home/trippels/gcc_6/usr/local/include/c++/6.0.0/bits/unique_ptr.h:146:57: note: the incompatible type is defined here typedef std::tuple<typename _Pointer::type, _Dp> __tuple_type; ^ /home/trippels/gcc_6/usr/local/include/c++/6.0.0/bits/unique_ptr.h:151:41: warning: type ‘struct element_type’ violates one definition rule [-Wodr] typedef _Tp element_type; ^ /home/trippels/gcc_6/usr/local/include/c++/6.0.0/bits/unique_ptr.h:151:41: note: a different type is defined in another translation unit typedef _Tp element_type; ^ foo1.cpp:4:7: note: the first difference of corresponding definitions is field ‘i’ int i; ^ foo2.cpp:4:8: note: a field with different name is defined in another translation unit bool a; ^