Commit 6c19e703 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/82401 (error: qsort comparator non-negative on sorted output: 1 in…

re PR c++/82401 (error: qsort comparator non-negative on sorted output: 1 in insert_late_enum_def_bindings on an invalid code)

	PR c++/82401
	* name-lookup.c (member_name_cmp): Return 0 if a == b.

	* g++.dg/cpp0x/pr82401.C: New test.

From-SVN: r255084
parent 52af3804
2017-11-22 Jakub Jelinek <jakub@redhat.com>
PR c++/82401
* name-lookup.c (member_name_cmp): Return 0 if a == b.
2017-11-22 David Malcolm <dmalcolm@redhat.com> 2017-11-22 David Malcolm <dmalcolm@redhat.com>
PR c++/62170 PR c++/62170
......
...@@ -1469,7 +1469,10 @@ member_name_cmp (const void *a_p, const void *b_p) ...@@ -1469,7 +1469,10 @@ member_name_cmp (const void *a_p, const void *b_p)
how we order these. Use UID as a proxy for source ordering, so how we order these. Use UID as a proxy for source ordering, so
that identically-located decls still have a well-defined stable that identically-located decls still have a well-defined stable
ordering. */ ordering. */
return DECL_UID (a) < DECL_UID (b) ? -1 : +1; if (DECL_UID (a) != DECL_UID (b))
return DECL_UID (a) < DECL_UID (b) ? -1 : +1;
gcc_assert (a == b);
return 0;
} }
static struct { static struct {
......
2017-11-22 Jakub Jelinek <jakub@redhat.com>
PR c++/82401
* g++.dg/cpp0x/pr82401.C: New test.
2017-11-22 David Malcolm <dmalcolm@redhat.com> 2017-11-22 David Malcolm <dmalcolm@redhat.com>
PR tree-optimization/82588 PR tree-optimization/82588
......
// PR c++/82401
// { dg-do compile { target c++11 } }
// { dg-options "" }
template <typename T> struct A
{
enum E : T;
void h ();
};
template <typename T> enum A<T>::E : T { e1, e2 };
template <> enum A<long long>::E : long long {};
template <typename T> struct C
{
enum class E : T;
};
C<int>::E c3 = C<int>::E::e1; // { dg-error "is not a member of" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment