crash25.C: Adjust.

gcc/testsuite/ChangeLog

2011-12-31  Fabien Chene  <fabien@gcc.gnu.org>

	* g++.old-deja/g++.brendan/crash25.C: Adjust.
	* g++.old-deja/g++.brendan/crash56.C: Likewise.
	* g++.old-deja/g++.jason/access14.C: Likewise.
	* g++.old-deja/g++.jason/access8.C: Likewise.
	* g++.old-deja/g++.jason/access1.C: Likewise.
	* g++.old-deja/g++.other/access3.C: Likewise.
	* g++.old-deja/g++.other/access5.C: Likewise.
	* g++.old-deja/g++.law/unsorted1.C: Likewise.
	* g++.old-deja/g++.law/visibility22.C: Likewise.
	* g++.old-deja/g++.law/visibility26.C: Likewise.
	* g++.old-deja/g++.mike/p2746.C: Likewise.
	* g++.dg/debug/using1.C: Likewise.
	* g++.dg/lookup/using51.C: Likewise.
	* g++.dg/inherit/using5.C: Likewise.
	* g++.dg/inherit/pr30297.C: Likewise.
	* g++.dg/inherit/access8.C: Likewise.
	* g++.dg/torture/pr39362.C: Likewise.
	* g++.dg/template/crash13.C: Likewise.
	* g++.dg/template/using10.C: Likewise.

gcc/cp/ChangeLog

2011-12-31  Fabien Chene  <fabien@gcc.gnu.org>

	* parser.c (cp_parser_using_declaration): Add a warning about
	deprecated access declarations when no errors were encountered
	while parsing the access declaration. Save the first token in
	order to emit the warning at the right place.

From-SVN: r182772
This commit is contained in:
Fabien Chêne 2012-01-01 18:26:23 +01:00
parent b4cbc46c32
commit 5135baed7d
21 changed files with 67 additions and 23 deletions

View File

@ -1,3 +1,10 @@
2011-12-31 Fabien Chêne <fabien@gcc.gnu.org>
* parser.c (cp_parser_using_declaration): Add a warning about
deprecated access declarations when no errors were encountered
while parsing the access declaration. Save the first token in
order to emit the warning at the right place.
2011-12-31 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51397

View File

@ -14887,9 +14887,14 @@ cp_parser_using_declaration (cp_parser* parser,
tree decl;
tree identifier;
tree qscope;
int oldcount = errorcount;
cp_token *diag_token = NULL;
if (access_declaration_p)
cp_parser_parse_tentatively (parser);
{
diag_token = cp_lexer_peek_token (parser->lexer);
cp_parser_parse_tentatively (parser);
}
else
{
/* Look for the `using' keyword. */
@ -15000,7 +15005,13 @@ cp_parser_using_declaration (cp_parser* parser,
/* Look for the final `;'. */
cp_parser_require (parser, CPP_SEMICOLON, RT_SEMICOLON);
if (access_declaration_p && errorcount == oldcount)
warning_at (diag_token->location, OPT_Wdeprecated,
"access declarations are deprecated "
"in favour of using-declarations; "
"suggestion: add the %<using%> keyword");
return true;
}

View File

@ -1,3 +1,25 @@
2011-12-31 Fabien Chêne <fabien@gcc.gnu.org>
* g++.old-deja/g++.brendan/crash25.C: Adjust.
* g++.old-deja/g++.brendan/crash56.C: Likewise.
* g++.old-deja/g++.jason/access14.C: Likewise.
* g++.old-deja/g++.jason/access8.C: Likewise.
* g++.old-deja/g++.jason/access1.C: Likewise.
* g++.old-deja/g++.other/access3.C: Likewise.
* g++.old-deja/g++.other/access5.C: Likewise.
* g++.old-deja/g++.law/unsorted1.C: Likewise.
* g++.old-deja/g++.law/visibility22.C: Likewise.
* g++.old-deja/g++.law/visibility26.C: Likewise.
* g++.old-deja/g++.mike/p2746.C: Likewise.
* g++.dg/debug/using1.C: Likewise.
* g++.dg/lookup/using51.C: Likewise.
* g++.dg/inherit/using5.C: Likewise.
* g++.dg/inherit/pr30297.C: Likewise.
* g++.dg/inherit/access8.C: Likewise.
* g++.dg/torture/pr39362.C: Likewise.
* g++.dg/template/crash13.C: Likewise.
* g++.dg/template/using10.C: Likewise.
2012-01-01 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/51502

View File

@ -9,7 +9,7 @@ struct A
struct B : public A
{
A::d;
A::d; // { dg-warning "deprecated" }
};
B b;

View File

@ -13,8 +13,8 @@ public:
class B : private A
{
public:
A::i;
A::A1;
A::i; // { dg-warning "deprecated" }
A::A1; // { dg-warning "deprecated" }
};
void

View File

@ -7,5 +7,5 @@ struct A
extern "C" struct B : A
{
A::i;
A::i; // { dg-warning "deprecated" }
};

View File

@ -1,5 +1,6 @@
// PR c++/51382
// { dg-do compile }
// { dg-options "-Wno-deprecated" }
template< int Value >
struct Base

View File

@ -13,6 +13,7 @@ template <typename T> struct C
{
typedef typename A<T>::B X;
X::Y; // { dg-error "not a base type" }
// { dg-warning "deprecated" "" { target *-*-* } 15 }
};
C<void> c;

View File

@ -7,5 +7,5 @@ struct B {
template <typename T> class I : public B {};
template <typename T> class D : private I<T> {
I<T>::B::foo;
I<T>::B::foo; // { dg-warning "deprecated" }
};

View File

@ -57,7 +57,7 @@ template <typename T> struct I <T, 0> : H <T>
I (int capacity) { allocateBuffer (capacity); }
~I () { this->deallocateBuffer (buffer ()); }
using H <T>::allocateBuffer;
H <T>::buffer;
H <T>::buffer; // { dg-warning "deprecated" }
};
template <typename T, int cap = 0> struct J
{

View File

@ -14,5 +14,5 @@ public:
class buff_head : private port_head {
public:
static int rep;
port_head::cap;
port_head::cap; // { dg-warning "deprecated" }
};

View File

@ -1,5 +1,5 @@
// { dg-do assemble }
// { dg-options "" }
// { dg-options "-Wno-deprecated" }
// GROUPS passed old-abort
const bool FALSE = 0;

View File

@ -8,10 +8,10 @@ public:
class B: private A {
public:
A::foo;
A::foo; // { dg-warning "deprecated" }
};
void foo() {
B b;
b.foo (); // { dg-bogus "" }
b.foo (); // { dg-bogus "" }
}

View File

@ -4,7 +4,7 @@ template <class T> struct A { T t; };
template <class T> class B: private T {
public:
T::t; // { dg-bogus "" } doesn't recognize access decl
T::t; // { dg-warning "deprecated" }
};
template class B<A<int> >;

View File

@ -12,7 +12,7 @@ protected:
class mel : private inh {
protected:
int t;
inh::myf;
inh::myf; // { dg-warning "deprecated" }
};
class top_t : protected mel {

View File

@ -20,7 +20,7 @@ class B : public A {
class C : private B {
public:
B::func;
B::func; // { dg-warning "deprecated" }
};
class D {

View File

@ -19,7 +19,7 @@ public:
class B : private A {
protected:
A::f;
A::f; // { dg-warning "deprecated" }
public:
A::g;
A::g; // { dg-warning "deprecated" }
};

View File

@ -14,5 +14,7 @@ class X {
class Y : private X {
public:
void f(int);
X::f; // used to be an error; now equivalent to 'using X::f'
// 'X::f' used to be an error; now equivalent to 'using X::f'
X::f; // { dg-warning "deprecated" }
};

View File

@ -86,7 +86,7 @@ public:
void remove(T *p) { IListBase::remove(p); }
T *head() { return (T *)IListBase::head(); }
T *get() { return (T *)IListBase::get(); }
IListBase::empty;
IListBase::empty; // { dg-warning "deprecated" }
friend class IListIter<T>;
};
@ -136,8 +136,8 @@ class IListIter : private IListIterBase {
public:
IListIter(const IList<T> &list) : IListIterBase(list) { }
T *cur() { return (T *)IListIterBase::cur(); }
IListIterBase::next;
IListIterBase::done;
IListIterBase::next; // { dg-warning "deprecated" }
IListIterBase::done; // { dg-warning "deprecated" }
};

View File

@ -10,7 +10,7 @@ struct A
struct B: private virtual A
{
A::f;
A::f; // { dg-warning "deprecated" }
};
struct C: private virtual A, public B

View File

@ -9,7 +9,7 @@ protected:
class B : private A
{
protected:
A::i;
A::i; // { dg-warning "deprecated" }
};
struct C : public B {