hanchenye-llvm-project/clang/test
Alexander Musman 94f14d9b73 Fix assertion on C++ attributes in fillAttributedTypeLoc
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
2015-05-29 11:24:32 +00:00
..
ARCMT [Objective-C SDK modernizer]. Patch to convert setter/getter 2015-04-02 21:36:03 +00:00
ASTMerge XFAIL Hexagon until more codegen in place. 2015-04-29 22:54:40 +00:00
Analysis Detect uses of mismatching forms of 'new' and 'delete' 2015-05-18 19:59:11 +00:00
CXX [Sema] Don't crash on out-of-line virtual constexpr functions 2015-05-22 05:49:41 +00:00
CodeCompletion
CodeGen [CodeGen] Update a test-case affected by folding IntToPtr/PtrToInt into Loads 2015-05-28 18:51:36 +00:00
CodeGenCUDA [cuda] Fixed test case failure on s390x 2015-05-11 18:35:58 +00:00
CodeGenCXX Get the dll storage class right for structors of classes exported/imported via explicit instantiation (PR23667) 2015-05-28 17:44:56 +00:00
CodeGenObjC Implement no_sanitize attribute. 2015-05-15 18:33:32 +00:00
CodeGenObjCXX Changed renaming of local symbols by inserting a dot vefore the numeric suffix 2015-05-12 16:48:43 +00:00
CodeGenOpenCL clang/test/CodeGenOpenCL/opencl_types.cl: Tweak expressions according to r237548. 2015-05-18 03:58:27 +00:00
Coverage
CoverageMapping InstrProf: Only disable coverage in built-in macros, not all system macros 2015-05-14 22:14:10 +00:00
Driver [omp] Loosen the driver test enough so that overriding the defaults 2015-05-28 21:20:14 +00:00
FixIt Move fixit for const init from note to diag, weaken to warning in MS mode. 2015-04-17 08:32:38 +00:00
Format Reapply r236854 and fixed r236867. 2015-05-10 07:47:19 +00:00
Frontend Don't leak TemplateIds when a plugin parses late-parsed templates at TU end. 2015-05-17 01:07:16 +00:00
Headers This patch adds support for the vector quadword add/sub instructions introduced 2015-05-25 15:52:45 +00:00
Index [modules] Move implicit creation of ImportDecls for #includes transformed into module imports from the frontend into Sema where it belongs. 2015-05-18 05:35:52 +00:00
Integration
Layout __declspec is not a core Clang language extension. Instead, require -fms-extensions or -fborland to enable the language extension. 2015-05-26 19:44:52 +00:00
Lexer Apply existing checks to C++1Z (has_feature_cxx0x); NFC 2015-05-22 02:57:28 +00:00
Misc Fix typo from r237482. "to reference of type" --> "to reference to type" 2015-05-16 01:39:39 +00:00
Modules [modules] If we re-enter a submodule from within itself (when submodule 2015-05-21 01:20:10 +00:00
OpenMP [OPENMP] Prepare codegen for privates in tasks for non-capturing of privates in CapturedStmt. 2015-05-22 08:56:35 +00:00
PCH [OPENMP] -fopenmp enables OpenMP support (fix for http://llvm.org/PR23492) 2015-05-20 04:24:19 +00:00
Parser __declspec is not a core Clang language extension. Instead, require -fms-extensions or -fborland to enable the language extension. 2015-05-26 19:44:52 +00:00
Preprocessor [Basic] Define __declspec for cygwin 2015-05-28 04:36:18 +00:00
Profile Fix PPC failure. Adjust CHECK pattern. 2015-05-28 11:25:52 +00:00
Rewriter __declspec is not a core Clang language extension. Instead, require -fms-extensions or -fborland to enable the language extension. 2015-05-26 19:44:52 +00:00
Sema AST: Fix printing GNU old-style field designators 2015-05-28 22:19:36 +00:00
SemaCUDA [cuda] Preserve TLS storage class of host variable even if it's a 2015-04-28 20:31:49 +00:00
SemaCXX Fix assertion on C++ attributes in fillAttributedTypeLoc 2015-05-29 11:24:32 +00:00
SemaObjC Tweak availability checking to look through typedef declarations. 2015-05-14 22:07:25 +00:00
SemaObjCXX [Objective-C Sema] Fixes a typo which did not allow 2015-04-10 22:07:47 +00:00
SemaOpenCL Restores r228382, which was reverted in r228406. 2015-02-25 05:48:23 +00:00
SemaTemplate Limit set of types instantiated in FindInstantiatedDecl. 2015-05-15 10:10:28 +00:00
TableGen
Tooling
Unit
VFS DebugInfo: Metadata constructs now start with DI* 2015-04-29 16:40:08 +00:00
.clang-format
CMakeLists.txt Revert "Wrap clang module files in a Mach-O, ELF, or COFF container." 2015-02-25 02:44:04 +00:00
Makefile
TestRunner.sh
cxx-sections.data
lit.cfg
lit.site.cfg.in
make_test_dirs.pl