[PATCH] D29880: Workaround MSVC bug when using TrailingObjects from a template.

Hugh Bellamy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 12 20:54:49 PST 2017


hughbe added a comment.

Nice - this is much cleaner than my attempt!

One nit: it seems like Clang (http://rextester.com/USGA76943) and GCC (http://rextester.com/PLDJ4987) can compile both conditional compilation blocks. Perhaps we can just get rid of the conditional compilation and use "template<typename T> using OverloadToken = typename ParentType::template OverloadToken<T>;"

I know it's uglier, but perhaps conditional compilation is ugly too!

I don't have access to a PC with VS right now (so can't fully test this).

However, I can confirm that MSVC compiles the original code that failed to compile with this change, according to an online compiler: http://rextester.com/LLI94126


https://reviews.llvm.org/D29880





More information about the llvm-commits mailing list