This is the mail archive of the 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 for c++/47721 (N1791, friend T)

And as a prerequisite for that testcase, I needed to implement DR 1004, dropping the pedwarn about using an injected class name as a template template parameter.

Tested x86_64-pc-linux-gnu, applying to trunk.
commit 0407c6ff58d0e7033de64040ce66d60a85b709e5
Author: Jason Merrill <>
Date:   Thu May 26 15:00:08 2011 -0400

    	DR 1004
    	* pt.c (convert_template_argument): Don't complain about using
    	injected-class-name as template template argument.

diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 3b26700..28c82b8 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -5962,7 +5962,9 @@ convert_template_argument (tree parm,
       tree t = maybe_get_template_decl_from_type_decl (TYPE_NAME (arg));
       if (TREE_CODE (t) == TEMPLATE_DECL)
-	  if (complain & tf_warning_or_error)
+	  if (cxx_dialect >= cxx0x)
+	    /* OK under DR 1004.  */;
+	  else if (complain & tf_warning_or_error)
 	    pedwarn (input_location, OPT_pedantic, "injected-class-name %qD"
 		     " used as template template argument", TYPE_NAME (arg));
 	  else if (flag_pedantic_errors)

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