[LLVMbugs] [Bug 10458] New: poor diagnostic when trying to use 'auto' not in '0x mode

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jul 23 13:12:23 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=10458

           Summary: poor diagnostic when trying to use 'auto' not in '0x
                    mode
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: clattner at apple.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


When trying to use auto (in this case in an range loop) but without '0x mode
enabled, you get an error like:


Test.cpp:88:14: error: C++ requires a type specifier for all declarations
  for (auto &I : MyVector) {
       ~~~~  ^
Test.cpp:88:8: error: loop variable 'I' may not be declared 'auto'
  for (auto &I : Fields) {
       ^

It should say that 'auto' isn't supported in C++'98 mode and recover well.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list