aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@cygnus.com>1998-09-03 16:09:01 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>1998-09-03 16:09:01 +0000
commitd67343c9e1ebba5433f23e933df9f8f6a4fe6b58 (patch)
tree71a95ded28097c380ce9ac1c8a19f49a96661f7c /gcc
parenta3a1dbf679f5e27c48e9b8fd7831c0557df5ff8b (diff)
downloadgcc-d67343c9e1ebba5433f23e933df9f8f6a4fe6b58.zip
gcc-d67343c9e1ebba5433f23e933df9f8f6a4fe6b58.tar.gz
gcc-d67343c9e1ebba5433f23e933df9f8f6a4fe6b58.tar.bz2
invoke.texi (Warning Options): Add -Wnon-template-friend documentation.
� Thu Sep 3 18:17:34 1998 Benjamin Kosnik <bkoz@cygnus.com> * invoke.texi (Warning Options): Add -Wnon-template-friend documentation. g++/17054 From-SVN: r22216
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/invoke.texi28
2 files changed, 28 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 59f0ef2..b1dc2c9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Thu Sep 3 18:17:34 1998 Benjamin Kosnik <bkoz@cygnus.com>
+
+ * invoke.texi (Warning Options): Add -Wnon-template-friend
+ documentation.
+
Thu Sep 3 18:16:16 1998 Michael Meissner <meissner@cygnus.com>
* rs6000.c (rs6000_override_options): Add -mcpu={401,e603e}.
diff --git a/gcc/invoke.texi b/gcc/invoke.texi
index 617875a..6751d87 100644
--- a/gcc/invoke.texi
+++ b/gcc/invoke.texi
@@ -124,11 +124,11 @@ in the following sections.
-Wlarger-than-@var{len} -Wlong-long
-Wmain -Wmissing-declarations
-Wmissing-prototypes -Wmultichar -Wnested-externs -Wno-import
--Wold-style-cast -Woverloaded-virtual -Wparentheses
--Wpointer-arith -Wredundant-decls -Wreorder -Wreturn-type
--Wshadow -Wsign-compare -Wstrict-prototypes -Wswitch
--Wsynth -Wtemplate-debugging -Wtraditional -Wtrigraphs
--Wundef -Wuninitialized -Wunused -Wwrite-strings
+-Wno-non-template-friend -Wold-style-cast -Woverloaded-virtual
+-Wparentheses -Wpointer-arith -Wredundant-decls -Wreorder
+-Wreturn-type -Wshadow -Wsign-compare -Wstrict-prototypes
+-Wswitch -Wsynth -Wtemplate-debugging -Wtraditional
+-Wtrigraphs -Wundef -Wuninitialized -Wunused -Wwrite-strings
-Wunknown-pragmas
@end smallexample
@@ -1184,6 +1184,8 @@ have meanings only for C++ programs:
Do not assume @samp{inline} for functions defined inside a class scope.
@xref{Optimize Options,,Options That Control Optimization}.
+@item -Wno-non-template-friend
+@xref{Warning Options,,Options to Request or Suppress Warnings}.
@item -Wold-style-cast
@itemx -Woverloaded-virtual
@itemx -Wtemplate-debugging
@@ -1675,6 +1677,22 @@ cases where multiple declaration is valid and changes nothing.
@item -Wnested-externs
Warn if an @code{extern} declaration is encountered within an function.
+@item -Wno-non-template-friend
+Disable warnings when non-templatized friend functions are declared
+within a template. With the advent of explicit template specification
+support in g++, if the name of the friend is an unqualified-id (ie,
+@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++, @samp{-Wnon-template-friend} allows the compiler to
+check existing code for potential trouble spots, and is on by default.
+This new compiler behavior can also be turned off with the flag
+@samp{-fguiding-decls}, which activates the older, non-specification
+compiler code, or with @samp{-Wno-non-template-friend} which keeps the
+conformant compiler code but disables the helpful warning.
+
@item -Winline
Warn if a function can not be inlined, and either it was declared as inline,
or else the @samp{-finline-functions} option was given.