This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ PATCH] Template template parameter conformace issue (PR9737)


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 at codesourcery dot com : http://www.cs.bris.ac.uk/~nathan/ : nathan at acm dot org



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]