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++/51911] New: [C++11] G++ accepts new auto { list }


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51911

             Bug #: 51911
           Summary: [C++11] G++ accepts new auto { list }
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jason@gcc.gnu.org


If the auto type-specifier appears in the type-specifier-seq of a new-type-id
or type-id of a new-expression, the new-expression shall contain a
new-initializer of the form ( assignment-expression )

So this shouldn't compile:

#include <initializer_list>
int main()
{
    auto foo = new auto {3, 4, 5};
}


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