Reorder conditions in uses-allocator construction helper
authorJonathan Wakely <jwakely@redhat.com>
Tue, 24 Jul 2018 13:03:25 +0000 (14:03 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 24 Jul 2018 13:03:25 +0000 (14:03 +0100)
commit4f3c75ba3a62d6f3794afd10d191807a68d7ba3b
tree8cab9715292c43bb5134cb78f788dd258ee8db13
parent7a4be380498046d9b0f88d32ff5a3189c913cc75
Reorder conditions in uses-allocator construction helper

The erased_type condition is only true for code using the Library
Fundamentals TS, so assume it's less common and only check it after
checking for convertibility.

This does mean for types using erased_type the more expensive
convertibility check is done first, but such types are rare.

* include/bits/uses_allocator.h (__is_erased_or_convertible): Reorder
conditions. Add comments.
* testsuite/20_util/uses_allocator/69293_neg.cc: Adjust dg-error line.
* testsuite/20_util/uses_allocator/cons_neg.cc: Likewise.
* testsuite/20_util/scoped_allocator/69293_neg.cc: Likewise.

From-SVN: r262945
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/uses_allocator.h
libstdc++-v3/testsuite/20_util/scoped_allocator/69293_neg.cc
libstdc++-v3/testsuite/20_util/uses_allocator/69293_neg.cc
libstdc++-v3/testsuite/20_util/uses_allocator/cons_neg.cc