[Bug c++/47651] New: "new (T(*[1]))" is parsed as a functional-cast getting a lambda-expression
schaub.johannes at googlemail dot com
gcc-bugzilla@gcc.gnu.org
Tue Feb 8 22:31:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47651
Summary: "new (T(*[1]))" is parsed as a functional-cast getting
a lambda-expression
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: schaub.johannes@googlemail.com
GCC rejects the following code, which I think is a regression:
struct A { };
int main() {
new (A(*[1]));
}
"warning: lambda expressions only available with -std=c++0x or -std=gnu++0x".
"error: no matching function for call to 'A::A(void (&)())'"
It should really create an array of 1 A* pointer. Credits go do this guy:
http://stackoverflow.com/q/4925647/34509
More information about the Gcc-bugs
mailing list