diff options
author | Sandra Loosemore <sandra@codesourcery.com> | 2017-02-16 23:48:36 -0500 |
---|---|---|
committer | Sandra Loosemore <sandra@gcc.gnu.org> | 2017-02-16 23:48:36 -0500 |
commit | 6a011df26ef12e31343fcb2ce4f47fb74be34f71 (patch) | |
tree | d705d407990ae95bdf6a2bec1822652eff69bc0a /gcc | |
parent | b1fc8cc8ba653313edfd803d03ed3260ab2dd607 (diff) | |
download | gcc-6a011df26ef12e31343fcb2ce4f47fb74be34f71.zip gcc-6a011df26ef12e31343fcb2ce4f47fb74be34f71.tar.gz gcc-6a011df26ef12e31343fcb2ce4f47fb74be34f71.tar.bz2 |
invoke.texi (C++ Dialect Options): Correct terminology and de-emphasize pre-standard behavior.
2017-02-16 Sandra Loosemore <sandra@codesourcery.com>
gcc/
* doc/invoke.texi (C++ Dialect Options) [-Wno-non-template-friend]:
Correct terminology and de-emphasize pre-standard behavior.
From-SVN: r245525
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/doc/invoke.texi | 20 |
2 files changed, 12 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5a96b4a..dd08b7d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-02-16 Sandra Loosemore <sandra@codesourcery.com> + + * doc/invoke.texi (C++ Dialect Options) [-Wno-non-template-friend]: + Correct terminology and de-emphasize pre-standard behavior. + 2017-02-16 Alan Modra <amodra@gmail.com> PR rtl-optimization/79286 diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 247d16b..72038a1 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -2996,19 +2996,13 @@ But this use is not portable across different compilers. @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)} @opindex Wno-non-template-friend @opindex Wnon-template-friend -Disable warnings when non-templatized friend functions are declared -within a template. Since the advent of explicit template specification -support in G++, if the name of the friend is an unqualified-id (i.e., -@samp{friend foo(int)}), the C++ language specification demands that the -friend declare or define an ordinary, nontemplate function. (Section -14.5.3). Before G++ implemented explicit specification, unqualified-ids -could be interpreted as a particular specialization of a templatized -function. Because this non-conforming behavior is no longer the default -behavior for G++, @option{-Wnon-template-friend} allows the compiler to -check existing code for potential trouble spots and is on by default. -This new compiler behavior can be turned off with -@option{-Wno-non-template-friend}, which keeps the conformant compiler code -but disables the helpful warning. +Disable warnings when non-template friend functions are declared +within a template. In very old versions of GCC that predate implementation +of the ISO standard, declarations such as +@samp{friend int foo(int)}, where the name of the friend is an unqualified-id, +could be interpreted as a particular specialization of a template +function; the warning exists to diagnose compatibility problems, +and is enabled by default. @item -Wold-style-cast @r{(C++ and Objective-C++ only)} @opindex Wold-style-cast |