]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/17763 (Wrong context in error message for template parameter)
authorPaolo Carlini <pcarlini@suse.de>
Fri, 10 Aug 2007 18:04:46 +0000 (18:04 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 10 Aug 2007 18:04:46 +0000 (18:04 +0000)
/cp
2007-08-10  Paolo Carlini  <pcarlini@suse.de>

PR c++/17763
* error.c (dump_expr): Consistently use the *_cxx_*
variants of the pretty-print functions.

/testsuite
2007-08-10  Paolo Carlini  <pcarlini@suse.de>

PR c++/17763
* g++.dg/other/error16.C: New.

From-SVN: r127345

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

index a35ffdf33bbc2530a8963833e7714e7700c1ff2f..b4df615743d86f8715f12c248a33b67660a8dca8 100644 (file)
@@ -1,3 +1,9 @@
+2007-08-10  Paolo Carlini  <pcarlini@suse.de>
+
+       PR c++/17763
+       * error.c (dump_expr): Consistently use the *_cxx_*
+       variants of the pretty-print functions.
+
 2007-07-30  Paolo Carlini  <pcarlini@suse.de>
 
        PR c++/32108
index 2962fe655f64d4227c82cc58dee5fdf6c60d7324..1332b226e4f1df8e81c223194f683f4a304d6a34 100644 (file)
@@ -1420,13 +1420,13 @@ dump_expr (tree t, int flags)
            if (TREE_CODE (ob) == ADDR_EXPR)
              {
                dump_expr (TREE_OPERAND (ob, 0), flags | TFF_EXPR_IN_PARENS);
-               pp_dot (cxx_pp);
+               pp_cxx_dot (cxx_pp);
              }
            else if (TREE_CODE (ob) != PARM_DECL
                     || strcmp (IDENTIFIER_POINTER (DECL_NAME (ob)), "this"))
              {
                dump_expr (ob, flags | TFF_EXPR_IN_PARENS);
-               pp_arrow (cxx_pp);
+               pp_cxx_arrow (cxx_pp);
              }
            args = TREE_CHAIN (args);
          }
index 10a9da7ae02584b0ced4764ec91b02c752a8468f..2026f2fdc540bca6ff6eb1571b642fe8069b5cfd 100644 (file)
@@ -1,3 +1,8 @@
+2007-08-10  Paolo Carlini  <pcarlini@suse.de>
+
+       PR c++/17763
+       * g++.dg/other/error16.C: New.
+
 2007-08-01  Andreas Krebbel  <krebbel1@de.ibm.com>
 
        * gcc.dg/20070801-1.c: New testcase.
diff --git a/gcc/testsuite/g++.dg/other/error16.C b/gcc/testsuite/g++.dg/other/error16.C
new file mode 100644 (file)
index 0000000..1e34647
--- /dev/null
@@ -0,0 +1,14 @@
+// PR c++/17763
+
+template <typename U> struct Outer {
+    struct Inner {};
+    Inner foo();
+};
+
+typedef int X;
+typedef Outer<X> XOuter;
+
+int main() {
+  Outer<int>  ab;
+  ab.foo() == 1; // { dg-error "ab.Outer" }
+}