OSDN Git Service

PR c++/14085
authorgdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 15 Feb 2004 15:00:54 +0000 (15:00 +0000)
committergdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 15 Feb 2004 15:00:54 +0000 (15:00 +0000)
        * error.c (dump_decl): Handle TEMPLATE_TYPE_PARM.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77852 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/error.c
gcc/testsuite/g++.dg/other/nontype-1.C [new file with mode: 0644]

index 9117cdf..60a0354 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-15  Gabriel Dos Reis  <gdr@integrable-solutions.net>
+
+       PR c++/14085
+       * error.c (dump_decl): Handle TEMPLATE_TYPE_PARM.
+
 2004-02-14  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
 
        PR c++/13635
index ece2635..a276f7b 100644 (file)
@@ -940,6 +940,13 @@ dump_decl (tree t, int flags)
       dump_expr (t, flags);
       break;
 
+    case TEMPLATE_TYPE_PARM:
+      if (flags & TFF_DECL_SPECIFIERS)
+        pp_cxx_declaration (cxx_pp, t);
+      else
+        pp_type_id (cxx_pp, t);
+      break;
+
     default:
       pp_unsupported_tree (cxx_pp, t);
       /* Fall through to error.  */
diff --git a/gcc/testsuite/g++.dg/other/nontype-1.C b/gcc/testsuite/g++.dg/other/nontype-1.C
new file mode 100644 (file)
index 0000000..5a1fcd9
--- /dev/null
@@ -0,0 +1,7 @@
+template <class Op>
+bool asfun(Op f,
+           Op::first_argument_type a, // { dg-error "not a type" }
+           Op::second_argument_type b) // { dg-error "not a type" }
+{                               // { dg-error "no type" }
+   return Op(a, b);
+}