diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-11-22 23:35:52 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-11-22 23:35:52 +0100 |
commit | 6c19e703de27d0fd94bdf3e3941a4f5b7b72f4e4 (patch) | |
tree | f1d1ba8a4fceb120ca9dc9ae7121b2a78948ec46 /gcc/cp | |
parent | 52af380439eab2770ad65af495e2c1a281e4b097 (diff) | |
download | gcc-6c19e703de27d0fd94bdf3e3941a4f5b7b72f4e4.zip gcc-6c19e703de27d0fd94bdf3e3941a4f5b7b72f4e4.tar.gz gcc-6c19e703de27d0fd94bdf3e3941a4f5b7b72f4e4.tar.bz2 |
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
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f97187e..59e890f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +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> PR c++/62170 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 7c363b0..9f65c4d 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -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 that identically-located decls still have a well-defined stable 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 { |