User account creation filtered due to spam.

Bug 41431 - &main should be allowed within unevaluated operands.
Summary: &main should be allowed within unevaluated operands.
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.4.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-21 21:38 UTC by Johannes Schaub
Modified: 2011-09-28 21:34 UTC (History)
0 users

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Schaub 2009-09-21 21:38:59 UTC
The following code snippet is wrongly rejected

int main() { sizeof(&main); }

---
main.cpp: In function 'int main()':
main.cpp:1: warning: ISO C++ forbids taking address of function '::main'
---

But the Standard allows that within a sizeof, because according to 3.2/2 it does not constitute a "use" of main.
Comment 1 Paolo Carlini 2011-09-28 21:34:31 UTC
Fixed in 4.5.x or even earlier.