From d67343c9e1ebba5433f23e933df9f8f6a4fe6b58 Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Thu, 3 Sep 1998 16:09:01 +0000 Subject: invoke.texi (Warning Options): Add -Wnon-template-friend documentation. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit � Thu Sep 3 18:17:34 1998 Benjamin Kosnik * invoke.texi (Warning Options): Add -Wnon-template-friend documentation. g++/17054 From-SVN: r22216 --- gcc/ChangeLog | 5 +++++ gcc/invoke.texi | 28 +++++++++++++++++++++++----- 2 files changed, 28 insertions(+), 5 deletions(-) (limited to 'gcc') 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 + + * invoke.texi (Warning Options): Add -Wnon-template-friend + documentation. + Thu Sep 3 18:16:16 1998 Michael Meissner * 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. -- cgit v1.1