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

             Bug #: 11478
           Summary: clang -std=c++0x should report use of (obsolete)
                    typeof keyword
           Product: clang
           Version: 2.9
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++0x
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


clang -std=c++0x should report use of (obsolete) typeof keyword and suggest use
of decltype instead.

Instead clang gives inscrutable error messages.

0 280 Z% cat typeofbug.cpp
template<typename T>
class foo {
  typedef typeof(T() - T()) differenceType;
};
0 281 Z% clang -std=c++0x -c typeofbug.cpp
typeofbug.cpp:3:22: error: expected ')'
  typedef typeof(T() - T()) differenceType;
                     ^
typeofbug.cpp:3:17: note: to match this '('
  typedef typeof(T() - T()) differenceType;
                ^
typeofbug.cpp:3:11: error: C++ requires a type specifier for all declarations
  typedef typeof(T() - T()) differenceType;
  ~~~~~~~ ^
typeofbug.cpp:3:28: error: expected ';' at end of declaration list
  typedef typeof(T() - T()) differenceType;
                           ^
                           ;
3 errors generated.
1 282 Z%

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to