This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/54161] sizeof(void) expressions are accepted


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54161

--- Comment #2 from Daniel KrÃgler <daniel.kruegler at googlemail dot com> 2012-08-02 20:13:29 UTC ---
(In reply to comment #1)
> Jason can you double check whether we
> want to reject even without -pedantic?

I hope it will be active even without -pedantic

> Anyway, Daniel, it would be nice if you could add also SFINAE testcase too,
> because likely it's a different issue:[..]

Yes, you are right, I was generalizing too early here. The actual test case was
this one:

template<class T, class = decltype(sizeof(T))>
auto f(int) -> char;

template<class>
auto f(...) -> char(&)[2];

static_assert(sizeof(f<void>(0)) != 1, ""); // OK - Oops
static_assert(sizeof(f<void()>(0)) != 1, ""); // OK - Oops

but Jason reported on the core reflector that this is already a very special
situation that the core language needs to handle first. So lets take the SFINAE
rumors away from this report.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]