OSDN Git Service

cp/
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Nov 2009 16:36:43 +0000 (16:36 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Nov 2009 16:36:43 +0000 (16:36 +0000)
2009-11-27  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/38656
* cxx-pretty-print.c (pp_cxx_expression): Handle TEMPLATE_ID_EXPR.

testsuite/
2009-11-27  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/38656
* g++.dg/cpp0x/error2.C: New.

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

gcc/cp/ChangeLog
gcc/cp/cxx-pretty-print.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/error2.C [new file with mode: 0644]

index 032afa0..e804913 100644 (file)
@@ -1,5 +1,10 @@
 2009-11-27  Paolo Carlini  <paolo.carlini@oracle.com>
 
+       PR c++/38656
+       * cxx-pretty-print.c (pp_cxx_expression): Handle TEMPLATE_ID_EXPR.
+
+2009-11-27  Paolo Carlini  <paolo.carlini@oracle.com>
+
        PR c++/35112
        * pt.c (print_overloaded_functions): New.
        (print_candidates): Call the latter.
index 4851af9..305b7ed 100644 (file)
@@ -1092,6 +1092,10 @@ pp_cxx_expression (cxx_pretty_printer *pp, tree t)
       pp_cxx_ws_string (pp, "...");
       break;
 
+    case TEMPLATE_ID_EXPR:
+      pp_cxx_template_id (pp, t);
+      break;
+
     case NONTYPE_ARGUMENT_PACK:
       {
        tree args = ARGUMENT_PACK_ARGS (t);
index d0532ff..80ad4c2 100644 (file)
@@ -1,3 +1,8 @@
+2009-11-27  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/38656
+       * g++.dg/cpp0x/error2.C: New.
+
 2009-11-27  Michael Matz  <matz@suse.de>
 
        PR rtl-optimization/42084
diff --git a/gcc/testsuite/g++.dg/cpp0x/error2.C b/gcc/testsuite/g++.dg/cpp0x/error2.C
new file mode 100644 (file)
index 0000000..ca681eb
--- /dev/null
@@ -0,0 +1,9 @@
+// PR c++/38656
+// { dg-options "-std=c++0x" }
+
+template<int> int foo();
+
+template<typename F> void bar(F f)
+{
+  f((foo<0>()=0)...); // { dg-error "pattern '\\(foo\\<0\\>\\)\\(\\)=0'" }
+}