[C++ PATCH] Template template parameter conformace issue (PR9737)
Nathan Sidwell
nathan@codesourcery.com
Fri Apr 18 15:07:00 GMT 2003
Kriang Lerdsuwanakij wrote:
> Hi
>
> The following patch fixes an issue in template template parameter
> implementation that does not conform to the C++ standard. It's
> about how template template parameter and argument matching when
> the argument (the class template) is declared with default
> arguments. Previously, we allow code like:
>
> #include <vector>
> template <template <class> class TT> class C {};
> C<std::vector> c;
>
> despite the `vector' class template declared with two parameters,
> one with default argument std::allocator<T>. This is now
> consider non-standard compliance by core issue 150. This behavior
> is fixed by the patch below.
>
> However, this new behavior makes template template parameter
> feature rather useless when used together with standard C++ library
> classes. So an option `-fweak-template-templates' is also
> introduced to weaken the parameter/argument matching rule to
> allow the old behavior.
I think a better name for the flag would be -fdefault-template-template-args,
(I can't immediately think of anything shorter)
'weak' has connotations of weak linkage.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
The voices in my head said this was stupid too
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
More information about the Gcc-patches
mailing list