Summary: | C-style cast to void* of a pointer-to-member-function does not issue a warning/error | ||
---|---|---|---|
Product: | gcc | Reporter: | razeh |
Component: | c++ | Assignee: | Gabriel Dos Reis <gdr> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gcc-bugs, giovannibajo, pinskia, wolfgang.roehrl |
Priority: | P3 | Keywords: | accepts-invalid, diagnostic |
Version: | 3.3 | ||
Target Milestone: | 4.0.0 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2004-10-11 14:31:35 |
Description
razeh
2003-05-16 15:06:01 UTC
Responsible-Changed-From-To: unassigned->gdr Responsible-Changed-Why: Diagnostic mantainer. State-Changed-From-To: open->analyzed State-Changed-Why: Confirmed. The compiler should reject the C-style cast to void exactly like it does with reinterpret_cast<void*>. I tried also with -pedantic but there is simply no warning/ error for it. Subject: Re: C-style cast to void* of a pointer-to-member-function does not issue a warning/error oops, this is operator error. I've unassigned myself; until/unless this turns out to be a regression caused by one of my patches. Generic C++ front-end problem. mine. We only warn about all three cases with "-pedantic" in 4.0.0 only. There is a DR report asking if this is valid C++ or not, I think there is another bug about that. So closing as fixed. This was changed with the following patches: 2004-10-28 Nathan Sidwell <nathan@codesourcery.com> * typeck.c (composite_pointer_type): Remove comment about DR 195. (build_reinterpret_cast_1): Revert DR195 patch. Only emit a warning when being pedantic. (build_reinterpet_cast, build_c_cast): Adjust. 2004-10-20 Nathan Sidwell <nathan@codesourcery.com> * typeck.c (composite_pointer_type): Add comment about DR 195 (build_reinterpret_cast_1): Add for_reinterpret_cast_p parameter. Allow function pointer conversions that DR195 suggests. (build_reinterpret_cast, build_c_cast): Update build_reinterpret_cast_1 calls. 2004-10-19 Mark Mitchell <mark@codesourcery.com> PR c++/14035 .... |