summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/cxx11-gnu-attrs.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Allow writing calling convention attributes on function types.Aaron Ballman2018-05-031-3/+2
| | | | | | Calling convention attributes notionally appertain to the function type -- they modify the mangling of the function, change the behavior of assignment operations, etc. This commit allows the calling convention attributes to be written in the type position as well as the declaration position. llvm-svn: 331459
* Improve some infrastructure for extended parameter infos andJohn McCall2016-03-031-0/+1
| | | | | | | fix a bug with the instantiation of ns_consumed parameter attributes in ARC. llvm-svn: 262551
* Fix assertion on C++ attributes in fillAttributedTypeLocAlexander Musman2015-05-291-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this fixes http://llvm.org/PR17424 fillAttributedTypeLoc() function is only called with AttributeLists of either DeclarationChunk (which is used for each type in a declarator being parsed) or DeclSpec (which captures information about declaration specifiers). As C++11 attributes actually appertain to declarators, they are moved straight to the declarator’s attr list in distributeFunctionTypeAttrFromDeclSpec() function. 'Put them wherever you like' semantics is not supported for C++11 attributes (but is allowed for GNU attributes, for example). So when we meet an attribute while parsing the declaration, we cannot be sure if it appertains to either DeclarationChunk or DeclSpec. This investigation correlates with the history of changes of SemaType.cpp: • Asserts in fillAttributedTypeLoc() were added on 3 Mar 2011 in r126986 (http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon- 20110228/039638.html); • Distributing C++11 attrs to the declarator was added on 14 Jan 2013 in r172504 (http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon- 20130114/071830.html). Considering all written above I changed asserts in fillAttributedTypeLoc() to nullptr checks. This fixes PR17424 and related assertion on [[gnu::fastcall]] void __stdcall foo(); Author: Alexey Frolov Differential Revision: http://reviews.llvm.org/D9288 llvm-svn: 238550
* Sema: Don't give attribute alias vars with struct type an init exprDavid Majnemer2015-02-081-0/+3
| | | | | | | | | | We'd give the VarDecl a CXXConstructExpr even though it is annotated with an alias attribute. This would make us trip over sanity checking asserts. This fixes PR22493. llvm-svn: 228523
* Removing the alloc_size attribute. The attribute was semantically handled, ↵Aaron Ballman2013-12-211-2/+0
| | | | | | but silently ignored. Most of this feature was already reverted in June 2012 (r159016), this just cleans up the pieces left over. llvm-svn: 197866
* Switch %clang -cc1 tests to %clang_cc1Alp Toker2013-10-281-1/+1
| | | | llvm-svn: 193561
* Extend test to show an alias can be before a definition.Rafael Espindola2013-10-211-1/+2
| | | | llvm-svn: 193099
* Downgrade 'attribute ignored when parsing type' from error to warning, to matchRichard Smith2013-01-291-1/+1
| | | | | | | | | the diagnostic's warn_ name. Switch some places (notably C++11 attributes) which really wanted an error over to a different diagnostic. Finally, suppress the diagnostic entirely for __ptr32, __ptr64 and __w64, to avoid producing diagnostics in important system headers. llvm-svn: 173788
* Fix behavior of [[gnu::]] function attributes. Per g++'s behavior, theseRichard Smith2013-01-151-0/+10
| | | | | | | | | | | attributes appertain to a declaration, even though they would be much more naturally modelled as appertaining to a function type. Previously, we would try to distribute them from the declarator to the function type, then reject them for being at an incorrect location. Now, we just distribute them as far as the declarator; the existing attribute handling code can actually apply them there just fine. llvm-svn: 172504
* clang/test/SemaCXX/cxx11-gnu-attrs.cpp: Add explicit -triple ↵NAKAMURA Takumi2013-01-141-1/+1
| | | | | | x86_64-unknown-unknown, or it doesn't work for targetting win32. llvm-svn: 172404
* Add extra tests for [[gnu::...]] attributes, missed from r172382.Richard Smith2013-01-141-0/+45
llvm-svn: 172391
OpenPOWER on IntegriCloud