Commit 48c6522f by Paolo Carlini Committed by Paolo Carlini

invoke.texi ([Wsubobject-linkage]): Extend documentation.

2015-09-16  Paolo Carlini  <paolo.carlini@oracle.com>

	* doc/invoke.texi ([Wsubobject-linkage]): Extend documentation.

From-SVN: r227828
parent 86b107ae
2015-09-16 Paolo Carlini <paolo.carlini@oracle.com>
* doc/invoke.texi ([Wsubobject-linkage]): Extend documentation.
2015-09-16 Segher Boessenkool <segher@kernel.crashing.org> 2015-09-16 Segher Boessenkool <segher@kernel.crashing.org>
PR bootstrap/67587 PR bootstrap/67587
......
...@@ -4942,8 +4942,15 @@ be useful to facilitate the conversion to @code{nullptr} in C++11. ...@@ -4942,8 +4942,15 @@ be useful to facilitate the conversion to @code{nullptr} in C++11.
@opindex Wsubobject-linkage @opindex Wsubobject-linkage
@opindex Wno-subobject-linkage @opindex Wno-subobject-linkage
Warn if a class type has a base or a field whose type uses the anonymous Warn if a class type has a base or a field whose type uses the anonymous
namespace or depends on a type with no linkage. This warning is namespace or depends on a type with no linkage. If a type A depends on
enabled by default. a type B with no or internal linkage, defining it in multiple
translation units would be an ODR violation because the meaning of B
is different in each translation unit. If A only appears in a single
translation unit, the best way to silence the warning is to give it
internal linkage by putting it in an anonymous namespace as well. The
compiler doesn't give this warning for types defined in the main .C
file, as those are unlikely to have multiple definitions.
@option{-Wsubobject-linkage} is enabled by default.
@item -Wdate-time @item -Wdate-time
@opindex Wdate-time @opindex Wdate-time
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment