[llvm] r178147 - Cleanup the simplify_type implementation.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Jul 16 05:12:06 PDT 2013


> In terms of testing it in the unittests, though, you shouldn't need
> any fancy SFINAE; just do something like:
>
> using namespace llvm;
> struct IllegalCast;
> template<typename T> IllegalCast *cast(...) { return 0; }
> IllegalCast *testIllegalCast() {
>   return cast<SomeType>(SomeRValue);
> }
>
> This will compile if and only if the cast isn't viable, because
> overload resolution will always prefer a function with named
> arguments.

Good idea. I have added it to the patch.

> In terms of the patch itself, if I recall correctly, the enable_ifs
> you're removing are necessary to reject a T* where T is simplifiable.
> I could be wrong, though.

Sorry, can you give an example of what you want to reject?

> -Eli

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: application/octet-stream
Size: 3438 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130716/e5debd11/attachment.obj>


More information about the llvm-commits mailing list