From 6a011df26ef12e31343fcb2ce4f47fb74be34f71 Mon Sep 17 00:00:00 2001 From: Sandra Loosemore Date: Thu, 16 Feb 2017 23:48:36 -0500 Subject: [PATCH] invoke.texi (C++ Dialect Options): Correct terminology and de-emphasize pre-standard behavior. 2017-02-16 Sandra Loosemore gcc/ * doc/invoke.texi (C++ Dialect Options) [-Wno-non-template-friend]: Correct terminology and de-emphasize pre-standard behavior. From-SVN: r245525 --- gcc/ChangeLog | 5 +++++ 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 + + * doc/invoke.texi (C++ Dialect Options) [-Wno-non-template-friend]: + Correct terminology and de-emphasize pre-standard behavior. + 2017-02-16 Alan Modra 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 -- 2.7.4