This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/47651] New: "new (T(*[1]))" is parsed as a functional-cast getting a lambda-expression


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]