This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/47651] New: "new (T(*[1]))" is parsed as a functional-cast getting a lambda-expression
- From: "schaub.johannes at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 8 Feb 2011 22:29:18 +0000
- Subject: [Bug c++/47651] New: "new (T(*[1]))" is parsed as a functional-cast getting a lambda-expression
- Auto-submitted: auto-generated
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