This is the mail archive of the
mailing list for the GCC project.
Re: Doc question: is "templatized" a word?
- From: Sandra Loosemore <sandra at codesourcery dot com>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>, Gerald Pfeifer <gerald at pfeifer dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Sat, 11 Feb 2017 13:36:10 -0700
- Subject: Re: Doc question: is "templatized" a word?
- Authentication-results: sourceware.org; auth=none
- References: <589E8ED2.firstname.lastname@example.org> <alpine.LSU.email@example.com> <CAH6eHdRZwgzguxjt1Ab=vbvtphkx6DxaF+_45F1G3RX3D_Bvew@mail.gmail.com>
On 02/11/2017 06:21 AM, Jonathan Wakely wrote:
On 11 February 2017 at 08:48, Gerald Pfeifer wrote:
On Fri, 10 Feb 2017, Sandra Loosemore wrote:
The documentation for -Wno-non-template-friend refers to "non-templatized
friend functions" and "templatized functions". I don't see the term
"templatized" used anywhere in the C++ standard. This paragraph also uses
"nontemplate function", which I assume refers to the same thing the C++
standard spells "non-template function". So does "non-templatized function"
also mean "non-template function"? Or does it have some other meaning?
I would avoid "templatized" and believe "non-template function" is
more appropriate in your example.
s/templatized function/function template/
But I wonder if that warning is even useful nowadays. The example of
"friend foo(int);" is bogus and is correctly rejected:
fr.cc:2:17: error: ISO C++ forbids declaration of ‘foo’ with no type
I hadn't actually gotten that far :-) but it looks like that's an
implicit-int error unrelated to the actual purpose of this option.
This ended up on my todo list firstly because "templatized" didn't
spell-check, and secondly because the "new compiler behavior" documented
in connection with this option has existed at least since 1998 and can
hardly be considered "new" any more. Also I think the reference to
section 14.5.3 of the C++ standard is bit-rotten (it's 14.5.4 in the
c++0x draft I have handy).
I'll leave it up to the C++ experts to decide whether the option should
just be removed and the warning replaced with a hard error controlled by
some other flag. Otherwise the docs for this option need to be
rewritten to explain what it does without reference to ancient changes
in G++ from before templates were fully implemented. I can take a stab
at that if nobody else offers up some alternative text first.