This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54161] sizeof(void) expressions are accepted
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 02 Aug 2012 20:13:29 +0000
- Subject: [Bug c++/54161] sizeof(void) expressions are accepted
- Auto-submitted: auto-generated
- References: <bug-54161-4@http.gcc.gnu.org/bugzilla/>
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.