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++/40687] New: [C++0x]: error with auto and 7.1.6.4/7 in N2914


Hi, 

I think there is a bug in g++ 4.4 concerning the implementation of auto.
7.1.6.4/7 in N2914

The following program compiles, but it should be rejected by g++.

int main() 
{
    auto i = 10, d = 5.0; // error! shall not compile in C++0x

    return 0;
}

$ /opt/gcc-4.4/bin/g++ -v
Using built-in specs.
Target: i686-pc-cygwin
Configured with: ./configure --prefix=/opt/gcc-4.4
Thread model: single
gcc version 4.4.0 (GCC)

$ /opt/gcc-4.4/bin/g++ --std=c++0x -Wall g++4.4BugAutoN2914.cpp
g++4.4BugAutoN2914.cpp: In function 'int main()':
g++4.4BugAutoN2914.cpp:4: warning: unused variable 'i'
g++4.4BugAutoN2914.cpp:4: warning: unused variable 'd'


-- 
           Summary: [C++0x]: error with auto and 7.1.6.4/7 in N2914
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bernhard dot merkle at googlemail dot com


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


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