[PATCH] D27679: Simplify format member detection in FormatVariadic

Pavel Labath via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 14 10:08:34 PST 2016

On 14 December 2016 at 18:02, Zachary Turner <zturner at google.com> wrote:
> Can you give me an example of a trivial adapter with "broken" code and then
> how to fix it?  Doesn't this work?
> class FooAdapter : public FormatAdapter<int> {
> public:
>   explicit FooAdapter(int n) : FormatAdapter<int>(n) {}
> };

That will not work because the base constructor accepts a rvalue
reference, which will not bind to "n". To make it compile you need to
do a std::move(n). There's nothing truly broken there, it's just
moderately annoying.

More information about the llvm-commits mailing list