diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2015-09-16 15:14:39 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2015-09-16 15:14:39 +0000 |
commit | 48c6522f7147595cffbc9cec526e115a6ffd066b (patch) | |
tree | f240e6b322d75c1ac7d27be251a2194dfd4eecaa /gcc/doc | |
parent | 86b107aea11946765a6792e94bfc18759a7ea2d1 (diff) | |
download | gcc-48c6522f7147595cffbc9cec526e115a6ffd066b.zip gcc-48c6522f7147595cffbc9cec526e115a6ffd066b.tar.gz gcc-48c6522f7147595cffbc9cec526e115a6ffd066b.tar.bz2 |
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
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/invoke.texi | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 99c9685..547ee2d 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -4942,8 +4942,15 @@ be useful to facilitate the conversion to @code{nullptr} in C++11. @opindex Wsubobject-linkage @opindex Wno-subobject-linkage 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 -enabled by default. +namespace or depends on a type with no linkage. If a type A depends on +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 @opindex Wdate-time |