+2017-06-29 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * class.c (add_method): Change pair of errors to error + inform.
+ (handle_using_decl): Likewise.
+
2017-06-29 Jason Merrill <jason@redhat.com>
* constexpr.c, error.c, tree.c: Remove WITH_CLEANUP_EXPR handling.
continue;
}
error_at (DECL_SOURCE_LOCATION (method),
- "%q#D", method);
- error_at (DECL_SOURCE_LOCATION (fn),
- "conflicts with version inherited from %qT",
- basef);
+ "%q#D conflicts with version inherited from %qT",
+ method, basef);
+ inform (DECL_SOURCE_LOCATION (fn),
+ "version inherited from %qT declared here",
+ basef);
}
/* Otherwise defer to the other function. */
return false;
}
else
{
- error ("%q+#D cannot be overloaded", method);
- error ("with %q+#D", fn);
+ error_at (DECL_SOURCE_LOCATION (method),
+ "%q#D cannot be overloaded with %q#D", method, fn);
+ inform (DECL_SOURCE_LOCATION (fn),
+ "previous declaration %q#D", fn);
return false;
}
}
the same name already present in the current class. */;
else
{
- error ("%q+D invalid in %q#T", using_decl, t);
- error (" because of local method %q+#D with same name",
- old_value);
+ error_at (DECL_SOURCE_LOCATION (using_decl), "%qD invalid in %q#T "
+ "because of local method %q#D with same name",
+ using_decl, t, old_value);
+ inform (DECL_SOURCE_LOCATION (old_value),
+ "local method %q#D declared here", old_value);
return;
}
}
else if (!DECL_ARTIFICIAL (old_value))
{
- error ("%q+D invalid in %q#T", using_decl, t);
- error (" because of local member %q+#D with same name", old_value);
+ error_at (DECL_SOURCE_LOCATION (using_decl), "%qD invalid in %q#T "
+ "because of local member %q#D with same name",
+ using_decl, t, old_value);
+ inform (DECL_SOURCE_LOCATION (old_value),
+ "local member %q#D declared here", old_value);
return;
}
+2017-06-29 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * g++.dg/cpp0x/inh-ctor3.C: Adjust for dg-message vs dg-error.
+ * g++.dg/diagnostic/variadic1.C: Likewise.
+ * g++.dg/gomp/udr-3.C: Likewise.
+ * g++.dg/overload/error1.C: Likewise.
+ * g++.dg/overload/error2.C: Likewise.
+ * g++.dg/template/duplicate1.C: Likewise.
+ * g++.old-deja/g++.benjamin/warn02.C: Likewise.
+ * g++.old-deja/g++.brendan/arm2.C: Likewise.
+ * g++.old-deja/g++.other/redecl2.C: Likewise.
+ * g++.old-deja/g++.other/redecl4.C: Likewise.
+ * g++.old-deja/g++.pt/memtemp78.C: Likewise.
+
2017-06-29 Cesar Philippidis <cesar@codesourcery.com>
PR fortran/77765
B2(int);
};
struct D1 : B1, B2 {
- using B1::B1; // { dg-error "inherited" }
+ using B1::B1; // { dg-message "declared" }
using B2::B2; // { dg-error "inherited" }
}; // ill-formed: attempts to declare D1(int) twice
struct D2 : B1, B2 {
template<int N> struct B { };
template<typename... T> struct A
{
- B<sizeof...(T)> f(); // { dg-error "sizeof\\.\\.\\." }
+ B<sizeof...(T)> f(); // { dg-message "sizeof\\.\\.\\." }
B<42> f(); // { dg-error "cannot be overloaded" }
};
{
struct U
{
- #pragma omp declare reduction (bar: S: omp_out.s *= omp_in.s) // { dg-error "with" }
+ #pragma omp declare reduction (bar: S: omp_out.s *= omp_in.s) // { dg-message "previous" }
#pragma omp declare reduction (bar: S: omp_out.s += omp_in.s) // { dg-error "cannot be overloaded" }
};
}
struct U
{
#pragma omp declare reduction (bar: T: omp_out.t += omp_in.t)
- #pragma omp declare reduction (bar: S: omp_out.s *= omp_in.s) // { dg-error "with" }
+ #pragma omp declare reduction (bar: S: omp_out.s *= omp_in.s) // { dg-message "previous" }
#pragma omp declare reduction (bar: S: omp_out.s += omp_in.s) // { dg-error "cannot be overloaded" }
- #pragma omp declare reduction (bar: long: omp_out += omp_in) // { dg-error "with" }
+ #pragma omp declare reduction (bar: long: omp_out += omp_in) // { dg-message "previous" }
#pragma omp declare reduction (bar: long int: omp_out += omp_in) // { dg-error "cannot be overloaded" }
#pragma omp declare reduction (bar: short unsigned: omp_out += omp_in)
#pragma omp declare reduction (bar: short int: omp_out += omp_in)
template <typename T>
struct U
{
- #pragma omp declare reduction (bar: T: omp_out.s *= omp_in.s) // { dg-error "with" }
+ #pragma omp declare reduction (bar: T: omp_out.s *= omp_in.s) // { dg-message "previous" }
#pragma omp declare reduction (bar: T: omp_out.s += omp_in.s) // { dg-error "cannot be overloaded" }
};
U<S> u;
{
typedef V V2;
#pragma omp declare reduction (bar: T: omp_out.t += omp_in.t)
- #pragma omp declare reduction (bar: V: omp_out.s *= omp_in.s) // { dg-error "with" }
+ #pragma omp declare reduction (bar: V: omp_out.s *= omp_in.s) // { dg-message "previous" }
#pragma omp declare reduction (bar: V2: omp_out.s += omp_in.s) // { dg-error "cannot be overloaded" }
- #pragma omp declare reduction (bar: long: omp_out += omp_in) // { dg-error "with" }
+ #pragma omp declare reduction (bar: long: omp_out += omp_in) // { dg-message "previous" }
#pragma omp declare reduction (bar: long int: omp_out += omp_in) // { dg-error "cannot be overloaded" }
#pragma omp declare reduction (bar: short unsigned: omp_out += omp_in)
#pragma omp declare reduction (bar: short int: omp_out += omp_in)
struct S
{
- void f () {} // { dg-error "with" }
+ void f () {} // { dg-message "previous" }
int f () { return 0; } // { dg-error "overloaded" }
};
struct A
{
- void foo(); // { dg-error "with" }
+ void foo(); // { dg-message "previous" }
virtual void foo(); // { dg-error "cannot be overloaded" }
};
template<int> struct A
{
- ~A() {} // { dg-error "with" }
+ ~A() {} // { dg-message "previous" }
~A() {} // { dg-error "cannot be overloaded" }
};
class D
{
public:
- int foo2() {return b;} // { dg-error "with" }
+ int foo2() {return b;} // { dg-message "previous" }
int foo2() {return b;} // { dg-error "overloaded" }
int b;
};
class E
{
public:
- int foo2(); // { dg-error "with" }
+ int foo2(); // { dg-message "previous" }
int foo2(); // { dg-error "overloaded" }
int b;
};
class X {
public:
- int foo(); // { dg-error "with" }
+ int foo(); // { dg-message "previous" }
static int foo(); // error: redeclaration// { dg-error "overloaded" } .*
};
class Y {
public:
- static int foo(); // { dg-error "with" }
+ static int foo(); // { dg-message "previous" }
int foo(); // error: redeclaration// { dg-error "overloaded" } .*
};
// { dg-do assemble }
struct S {
- S(int); // { dg-error "with" }
+ S(int); // { dg-message "previous" }
S(int); // { dg-error "overloaded" } already declared
- ~S();// { dg-error "with" }
+ ~S();// { dg-message "previous" }
~S(); // { dg-error "overloaded" } already declared
};
// { dg-do assemble }
int main() {
struct A {
- void f(); // { dg-error "with" } already declared
+ void f(); // { dg-message "previous" } already declared
void f(); // { dg-error "overloaded" } already declared
};
}
struct C
{
template <class U>
- void f() {} // { dg-error "with" } redeclaration
+ void f() {} // { dg-message "previous" } redeclaration
template <class U>
void f() {} // { dg-error "overloaded" } redeclaration
template <class T, class U>
struct D2
{
- void f(T); // { dg-error "with" } redeclaration
+ void f(T); // { dg-message "previous" } redeclaration
void f(U); // { dg-error "overloaded" } redeclaration
};
struct E
{
- void f(); // { dg-error "with" } redeclaration
+ void f(); // { dg-message "previous" } redeclaration
void f(); // { dg-error "overloaded" } redeclaration
};