r188324 - sizeof(void) etc. should be a hard error in C++.

Eli Friedman eli.friedman at gmail.com
Tue Aug 13 17:51:11 PDT 2013


On Tue, Aug 13, 2013 at 5:40 PM, Arthur O'Dwyer
<arthur.j.odwyer at gmail.com>wrote:

> Eli, you say this affects SFINAE, but it doesn't look like you added
> any new tests that *verify* the intended effect. All your changes to
> test/ were just working around the changed diagnostic output.
>
> There should be some way to trigger this new behavior, right? How?
>
>
The SFINAE-specific aspect isn't really that interesting if you understand
clang's architecture... but here's an example.  It compiles with trunk, and
fails to compile without r188324.

template<typename T> float f(int(*)[sizeof(T)]);
template<typename T> double f(...);
static_assert(sizeof(f<void>(0)) == sizeof(double), "Wrong overload");

-Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130813/647e9b53/attachment.html>


More information about the cfe-commits mailing list