We should use the location of the using-declaration, not the location of the
class.
gcc/cp/ChangeLog:
* class.c (handle_using_decl): Add an iloc_sentinel.
gcc/testsuite/ChangeLog:
* g++.dg/lookup/using26.C: Adjust location.
* g++.old-deja/g++.other/using1.C: Adjust location.
-/* Functions related to building classes and their related objects.
+/* Functions related to building -*- C++ -*- classes and their related objects.
Copyright (C) 1987-2020 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com)
return;
}
+ iloc_sentinel ils (DECL_SOURCE_LOCATION (using_decl));
+
/* Make type T see field decl FDECL with access ACCESS. */
if (flist)
for (ovl_iterator iter (flist); iter; ++iter)
int next;
};
-struct D : A, B, C // { dg-error "context" }
+struct D : A, B, C
{
- using B::next;
+ using B::next; // { dg-error "context" }
void f()
{
next = 12;
friend class D2;
};
-class D : public B { // { dg-error "" } within this context
+class D : public B {
public:
- using B::a;
+ using B::a; // { dg-error "" } within this context
using B::b;
};