+2020-01-28 Martin Liska <mliska@suse.cz>
+
+ PR c++/92440
+ * pt.c (redeclare_class_template): Use inform
+ for the second location.
+
2020-01-27 Jason Merrill <jason@redhat.com>
PR c++/90966
!= TEMPLATE_PARM_PARAMETER_PACK (DECL_INITIAL (parm)))))
{
error ("template parameter %q+#D", tmpl_parm);
- error ("redeclared here as %q#D", parm);
+ inform (input_location, "redeclared here as %q#D", parm);
return false;
}
+2020-01-28 Martin Liska <mliska@suse.cz>
+
+ PR c++/92440
+ * g++.dg/template/pr92440.C: New test.
+ * g++.dg/cpp0x/vt-34314.C: Update error to note.
+ * g++.dg/template/pr59930-2.C: Likewise.
+ * g++.old-deja/g++.pt/redecl1.C: Likewise.
+
2020-01-28 Jakub Jelinek <jakub@redhat.com>
PR target/93418
struct call;
template<typename Fun, typename Arg0>
-struct call // { dg-error "redeclared here" }
+struct call // { dg-message "note: redeclared here" }
{
template<typename Sig>
struct result;
struct call2;
template<typename Fun, int N>
-struct call2 // { dg-error "redeclared here" }
+struct call2 // { dg-message "note: redeclared here" }
{
template<typename Sig>
struct result;
struct call3;
template<typename Fun, template<typename> class TT>
-struct call3 // { dg-error "redeclared here" }
+struct call3 // { dg-message "note: redeclared here" }
{
template<typename Sig>
struct result;
// Injects N::N
template < T > friend class N;
// { dg-error "template parameter" "" { target *-*-* } .-1 }
- // { dg-error "redeclared" "" { target *-*-* } .-2 }
+ // { dg-message "note: redeclared" "" { target *-*-* } .-2 }
};
}
--- /dev/null
+// PR c++/92440
+// { dg-do compile }
+
+template <int T> // { dg-error "template parameter" }
+struct S {
+ template <class U>
+ friend struct S; // { dg-message "note: redeclared here as" }
+};
+
+S<0> s;
// non-type template parameter.
template <int i> struct X; // { dg-error "template parameter" }
-template <int* p> struct X; // { dg-error "redeclared here" }
+template <int* p> struct X; // { dg-message "note: redeclared here" }
struct S3;
template <int I>
-struct S3; // { dg-error "redeclared here" }
+struct S3; // { dg-message "note: redeclared here" }
template <template <class T> class C>
-struct S3; // { dg-error "redeclared here" }
+struct S3; // { dg-message "note: redeclared here" }