Pavel Labath 2ef2a887ad Simplify format member detection in FormatVariadic
Summary:
This replaces the format member search, which was quite complicated, with a more
direct approach to detecting whether a class should be formatted using the
format-member method. Instead we use a special type llvm::format_adapter, which
every adapter must inherit from. Then the search can be simply implemented with
the is_base_of type trait.

Aside from the simplification, I like this way more because it makes it more
explicit that you are supposed to use this type only for adapter-like
formattings, and the other approach (format_provider overloads) should be used
as a default (a mistake I made when first trying to use this library).

The only slight change in behaviour here is that now choose the format-adapter
branch even if the format member invocation will fail to compile (e.g. because it is a
non-const member function and we are passing a const adapter), whereas
previously we would have gone on to search for format_providers for the type.
However, I think that is actually a good thing, as it probably means the
programmer did something wrong.

Reviewers: zturner, inglorion

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D27679

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289795 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 09:40:27 +00:00
..
2015-06-19 01:53:21 +00:00
2016-11-01 07:52:10 +00:00
2016-04-18 09:17:29 +00:00
2014-06-08 22:29:17 +00:00
2014-09-15 21:51:49 +00:00
2014-12-04 16:59:36 +00:00
2014-12-04 16:59:36 +00:00
2016-09-27 15:45:57 +00:00
2016-04-18 09:17:29 +00:00