pt.c (check_for_bare_parameter_packs): Improve error message location for expressions.
authorPaolo Carlini <paolo@gcc.gnu.org>
Mon, 23 May 2016 19:20:41 +0000 (19:20 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 23 May 2016 19:20:41 +0000 (19:20 +0000)
/cp
2016-05-23  Paolo Carlini  <paolo.carlini@oracle.com>

* pt.c (check_for_bare_parameter_packs): Improve error message
location for expressions.

/testsuite
2016-05-23  Paolo Carlini  <paolo.carlini@oracle.com>

* g++.dg/cpp0x/pr31445.C: Test column number too.
* g++.dg/cpp0x/pr32253.C: Likewise.
* g++.dg/cpp0x/variadic-ex13.C: Likewise.
* g++.dg/cpp0x/variadic36.C: Likewise.

From-SVN: r236609

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr31445.C
gcc/testsuite/g++.dg/cpp0x/pr32253.C
gcc/testsuite/g++.dg/cpp0x/variadic-ex13.C
gcc/testsuite/g++.dg/cpp0x/variadic36.C

index 9618a28..e6f4ac9 100644 (file)
@@ -1,3 +1,8 @@
+2016-05-23  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * pt.c (check_for_bare_parameter_packs): Improve error message
+       location for expressions.
+
 2016-05-20  Nathan Sidwell  <nathan@acm.org>
 
        * constexpr.c (cxx_bind_parameters_in_call): Avoid gratuitous if
index 2bba571..2ce8f40 100644 (file)
@@ -3761,7 +3761,8 @@ check_for_bare_parameter_packs (tree t)
 
   if (parameter_packs) 
     {
-      error ("parameter packs not expanded with %<...%>:");
+      location_t loc = EXPR_LOC_OR_LOC (t, input_location);
+      error_at (loc, "parameter packs not expanded with %<...%>:");
       while (parameter_packs)
         {
           tree pack = TREE_VALUE (parameter_packs);
@@ -3776,9 +3777,9 @@ check_for_bare_parameter_packs (tree t)
             name = DECL_NAME (pack);
 
          if (name)
-           inform (input_location, "        %qD", name);
+           inform (loc, "        %qD", name);
          else
-           inform (input_location, "        <anonymous>");
+           inform (loc, "        <anonymous>");
 
           parameter_packs = TREE_CHAIN (parameter_packs);
         }
index 4d39198..b4ca509 100644 (file)
@@ -1,3 +1,10 @@
+2016-05-23  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * g++.dg/cpp0x/pr31445.C: Test column number too.
+       * g++.dg/cpp0x/pr32253.C: Likewise.
+       * g++.dg/cpp0x/variadic-ex13.C: Likewise.
+       * g++.dg/cpp0x/variadic36.C: Likewise.
+
 2016-05-23  Marc Glisse  <marc.glisse@inria.fr>
 
        * gcc.dg/fold-notshift-2.c: Adjust.
@@ -16,7 +23,7 @@
        * g++.dg/gomp/target-1.C: Likewise.
        * g++.dg/gomp/target-2.C: Likewise.
        * gcc.dg/gomp/target-1.c: Likewise.
-       * gcc.dg/gomp/target-2.c: Likewise. 
+       * gcc.dg/gomp/target-2.c: Likewise.
        * g++.dg/gomp/taskgroup-1.C: Likewise.
        * gcc.dg/gomp/taskgroup-1.c: Likewise.
        * gcc.dg/gomp/teams-1.c: Likewise.
@@ -38,7 +45,7 @@
 
 2016-05-23  Venkataramanan Kumar  <venkataramanan.kumar@amd.com>
 
-       * gcc.dg/vect/bb-slp-19.c:  Remove XFAIL. 
+       * gcc.dg/vect/bb-slp-19.c:  Remove XFAIL.
        * gcc.dg/vect/pr58135.c:  Add new.
        * gfortran.dg/pr46519-1.f: Adjust test case.
 
index 89aae9a..b454281 100644 (file)
@@ -2,7 +2,7 @@
 template <typename... T> struct A
 {
   void foo(T...);
-  A(T... t) { foo(t); } // { dg-error "parameter packs|t" }
+  A(T... t) { foo(t); } // { dg-error "18:parameter packs|t" }
 };
 
 A<int> a(0);
index 2094b2d..bfb11e4 100644 (file)
@@ -1,7 +1,7 @@
 // { dg-do compile { target c++11 } }
 template<void (*... fp)()> struct A
 {
-  A() { fp(); } // { dg-error "not expanded|fp" }
+  A() { fp(); } // { dg-error "11:parameter packs not expanded|fp" }
 };
 
 void foo();
index fe29e71..ddf71a4 100644 (file)
@@ -33,7 +33,7 @@ template<typename... Args> void g(Args... args)
 {
    f(const_cast<const Args*>(&args)...); // okay: ``Args'' and ``args'' are expanded
    f(5 ...); // { dg-error "contains no argument packs" }
-   f(args); // { dg-error "parameter packs not expanded" }
+   f(args); // { dg-error "5:parameter packs not expanded" }
    // { dg-message "args" "note" { target *-*-* } 36 }
    f(h(args...) + args...); // okay: first ``args'' expanded within h, second ``args'' expanded within f.
 }
index c60e6d0..0bd068c 100644 (file)
@@ -2,7 +2,7 @@
 template<typename T, typename... Args>
 void f(const T&, const Args&... args)
 {
-  f(args); // { dg-error "packs not expanded" }
+  f(args); // { dg-error "4:parameter packs not expanded" }
 }
 
 template<typename... Values>