Go to file
Pavel Labath 08c2e86802 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

llvm-svn: 289795
2016-12-15 09:40:27 +00:00
clang Re-commit r289252 and r289285, and fix PR31374 2016-12-15 08:09:08 +00:00
clang-tools-extra [change-namespace] don't crash when type reference is in function type parameter list. 2016-12-14 17:01:52 +00:00
compiler-rt [XRay][compiler-rt][NFC] Deduplicate code in x86-64 trampolines. 2016-12-15 09:04:05 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc Fix build since r286752. 2016-11-14 16:06:33 +00:00
libcxx Fix typo 2016-12-15 07:23:44 +00:00
libcxxabi [libc++abi] Mark failing test on Darwin as XFAIL 2016-12-13 02:43:04 +00:00
libunwind EHABI: mark some functions as exported 2016-11-17 23:53:35 +00:00
lld [ELF] - Attempt to fix ubuntu bot. 2016-12-15 09:30:07 +00:00
lldb Fix incorrectly named variables. 2016-12-15 00:30:30 +00:00
llgo [llgo] Remove support for LLVM attributes 2016-12-06 19:22:04 +00:00
llvm Simplify format member detection in FormatVariadic 2016-12-15 09:40:27 +00:00
openmp Follow up to r289732: Update comments in source files to reference .cpp files 2016-12-14 23:01:24 +00:00
parallel-libs [Acxxel] Remove setActiveDeviceForThread 2016-10-28 00:54:02 +00:00
polly Remove references to AssumptionCache. NFC. 2016-12-15 09:25:14 +00:00