aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <paolo@gcc.gnu.org>2019-01-12 21:59:50 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2019-01-12 21:59:50 +0000
commit6f7814d08fd89dc9f41807568ef26c3ffe498dba (patch)
tree9bffe4983acddda577ab74ae72f4b0f7c104af9d
parent062ab4596d7b684f3781db1d484e5a9f1c9f5fd9 (diff)
downloadgcc-6f7814d08fd89dc9f41807568ef26c3ffe498dba.zip
gcc-6f7814d08fd89dc9f41807568ef26c3ffe498dba.tar.gz
gcc-6f7814d08fd89dc9f41807568ef26c3ffe498dba.tar.bz2
decl.c (cp_finish_decl): Improve error location.
/cp 2019-01-12 Paolo Carlini <paolo.carlini@oracle.com> * decl.c (cp_finish_decl): Improve error location. * decl2.c (grokfield): Likewise, improve two locations. /testsuite 2019-01-12 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/cpp0x/pr62101.C: Test locations too. * g++.dg/inherit/pure1.C: Likewise. From-SVN: r267888
-rw-r--r--gcc/testsuite/g++.dg/inherit/pure1.C11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/testsuite/g++.dg/inherit/pure1.C b/gcc/testsuite/g++.dg/inherit/pure1.C
index 364369b..fd81ff0 100644
--- a/gcc/testsuite/g++.dg/inherit/pure1.C
+++ b/gcc/testsuite/g++.dg/inherit/pure1.C
@@ -2,18 +2,19 @@
// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
// { dg-do compile }
-void foo0() = 0; // { dg-error "like a variable" }
+void foo0() = 0; // { dg-error "6:function .void foo0\\(\\). is initialized like a variable" }
virtual void foo1() = 0; // { dg-error "1:'virtual' outside class" }
-// { dg-error "like a variable" "" { target *-*-* } .-1 }
+// { dg-error "14:function .void foo1\\(\\). is initialized like a variable" "" { target *-*-* } .-1 }
struct A
{
- void foo2() = 0; // { dg-error "non-virtual" }
- static void foo3() = 0; // { dg-error "static member" }
+ void foo2() = 0; // { dg-error "8:initializer specified for non-virtual method" }
+ static void foo3() = 0; // { dg-error "15:initializer specified for static member function" }
virtual static void foo4() = 0; // { dg-error "both 'virtual' and 'static'" }
virtual void foo5() = 0; // { dg-error "base class" }
};
struct B : A
{
- static void foo5() = 0; // { dg-error "static member|declared" }
+ static void foo5() = 0; // { dg-error "15:initializer specified for static member function" }
+// { dg-error "declared" "" { target *-*-* } .-1 }
};