Add support for GCC's '__auto_type' extension, per the GCC manual:
https://gcc.gnu.org/onlinedocs/gcc/Typeof.html Differences from the GCC extension: * __auto_type is also permitted in C++ (but only in places where it could appear in C), allowing its use in headers that might be shared across C and C++, or used from C++98 * __auto_type can be combined with a declarator, as with C++ auto (for instance, "__auto_type *p") * multiple variables can be declared in a single __auto_type declaration, with the C++ semantics (the deduced type must be the same in each case) This patch also adds a missing restriction on applying typeof to a bit-field, which GCC has historically rejected in C (due to lack of clarity as to whether the operand should be promoted). The same restriction also applies to __auto_type in C (in both GCC and Clang). This also fixes PR25449. Patch by Nicholas Allegra! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252690 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/AST/ASTContext.h 1 addition, 1 deletioninclude/clang/AST/ASTContext.h
- include/clang/AST/Type.h 24 additions, 10 deletionsinclude/clang/AST/Type.h
- include/clang/Basic/DiagnosticGroups.td 2 additions, 0 deletionsinclude/clang/Basic/DiagnosticGroups.td
- include/clang/Basic/DiagnosticParseKinds.td 3 additions, 0 deletionsinclude/clang/Basic/DiagnosticParseKinds.td
- include/clang/Basic/DiagnosticSemaKinds.td 17 additions, 9 deletionsinclude/clang/Basic/DiagnosticSemaKinds.td
- include/clang/Basic/Specifiers.h 1 addition, 0 deletionsinclude/clang/Basic/Specifiers.h
- include/clang/Basic/TokenKinds.def 1 addition, 0 deletionsinclude/clang/Basic/TokenKinds.def
- include/clang/Sema/DeclSpec.h 3 additions, 1 deletioninclude/clang/Sema/DeclSpec.h
- lib/AST/ASTContext.cpp 5 additions, 5 deletionslib/AST/ASTContext.cpp
- lib/AST/ASTImporter.cpp 1 addition, 1 deletionlib/AST/ASTImporter.cpp
- lib/AST/ItaniumMangle.cpp 4 additions, 2 deletionslib/AST/ItaniumMangle.cpp
- lib/AST/MicrosoftMangle.cpp 2 additions, 0 deletionslib/AST/MicrosoftMangle.cpp
- lib/AST/Type.cpp 1 addition, 1 deletionlib/AST/Type.cpp
- lib/AST/TypePrinter.cpp 5 additions, 1 deletionlib/AST/TypePrinter.cpp
- lib/Format/TokenAnnotator.cpp 1 addition, 1 deletionlib/Format/TokenAnnotator.cpp
- lib/Parse/ParseDecl.cpp 6 additions, 0 deletionslib/Parse/ParseDecl.cpp
- lib/Parse/ParseObjc.cpp 1 addition, 0 deletionslib/Parse/ParseObjc.cpp
- lib/Parse/ParseTentative.cpp 3 additions, 0 deletionslib/Parse/ParseTentative.cpp
- lib/Sema/DeclSpec.cpp 2 additions, 0 deletionslib/Sema/DeclSpec.cpp
- lib/Sema/SemaDecl.cpp 6 additions, 2 deletionslib/Sema/SemaDecl.cpp
Loading
Please register or sign in to comment