llvm-project/clang/lib/Parse
Ulrich Weigand ef5aa29e12 Support alternate attribute spelling __enable_if__
Attribute names usually support an alternate spelling that uses double
underscores before and after the attribute name, like e.g. attribute
((__aligned__)) for attribute ((aligned)). This is necessary to allow
use of attributes in system headers without polluting the name space.

However, for attribute ((enable_if)) that alternate spelling does not
work correctly. This is because of code in Parser::ParseGNUAttributeArgs
(ParseDecl.cpp) that specifically checks for the "enable_if" spelling
without allowing the alternate spelling.

Similar code in ParseDecl.cpp uses the normalizeAttrName helper to allow
both spellings. This patch adds use of that helper for the "enable_if"
check as well, which fixes attribute ((__enable_if__)).

Differential Revision: http://reviews.llvm.org/D11142

llvm-svn: 242029
2015-07-13 14:13:01 +00:00
..
CMakeLists.txt [CMake] Reorder libdeps by alphabetical order. 2014-07-14 04:59:27 +00:00
Makefile
ParseAST.cpp Remove unneeded include of DeclCXX.h from libParse. 2014-12-28 01:52:28 +00:00
ParseCXXInlineMethods.cpp Rework parsing of pure-specifiers. Perform the grammar matching and 2015-06-30 01:28:56 +00:00
ParseDecl.cpp Support alternate attribute spelling __enable_if__ 2015-07-13 14:13:01 +00:00
ParseDeclCXX.cpp Revert "parser: wordsmith diagnostic message" and "parser: diagnose empty attribute blocks" 2015-07-08 05:55:00 +00:00
ParseExpr.cpp [OPENMP] Introduced type trait "__builtin_omp_required_simd_align" for default simd alignment. 2015-07-02 03:40:19 +00:00
ParseExprCXX.cpp C++ support for Objective-C lightweight generics. 2015-07-07 03:58:14 +00:00
ParseInit.cpp Silence a -Wunused-variable warning; NFC. 2015-07-07 13:21:26 +00:00
ParseObjc.cpp [libclang] Implement proper code-completion in an ObjC type parameter position. 2015-07-07 06:20:36 +00:00
ParseOpenMP.cpp [OPENMP 4.0] Initial support for 'omp cancel' construct. 2015-07-02 11:25:17 +00:00
ParsePragma.cpp Add assume_safety option for pragma loop vectorize and interleave. 2015-06-11 23:23:17 +00:00
ParseStmt.cpp Revert r240270 ("Fixed/added namespace ending comments using clang-tidy"). 2015-06-22 23:07:51 +00:00
ParseStmtAsm.cpp Revert r240270 ("Fixed/added namespace ending comments using clang-tidy"). 2015-06-22 23:07:51 +00:00
ParseTemplate.cpp Parsing, semantic analysis, and AST for Objective-C type parameters. 2015-07-07 03:57:15 +00:00
ParseTentative.cpp Implement the Objective-C __kindof type qualifier. 2015-07-07 03:58:42 +00:00
Parser.cpp C++ support for Objective-C lightweight generics. 2015-07-07 03:58:14 +00:00
RAIIObjectsForParser.h Add a new error for unexpected semi-colon before closing delimiter. 2015-05-12 21:36:35 +00:00