summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Removing a number of individual run lines and replacing them with single ↵Aaron Ballman2013-07-231-15/+12
| | | | | | line test cases. This reduces the number of test runs, provides the same coverage, and allows us to test that the attribute names are included in the diagnostic. llvm-svn: 186982
* Added the attribute name to the err_attribute_wrong_number_arguments ↵Aaron Ballman2013-07-2314-38/+38
| | | | | | | | diagnostic for clarity; updated almost all of the affected test cases. Thanks to Fariborz Jahanian for the suggestion! llvm-svn: 186980
* Removed a redundant diagnostic and replaced it with a more standard one. ↵Aaron Ballman2013-07-231-0/+1
| | | | | | Added a test case for the diagnostic. llvm-svn: 186942
* Correcting the NSObject and Overloadable attribute diagnostics so that the ↵Aaron Ballman2013-07-231-0/+1
| | | | | | count reported matches reality. llvm-svn: 186936
* Integers which are too large should be an error.Eli Friedman2013-07-232-3/+3
| | | | | | | | Switch some warnings over to errors which should never have been warnings in the first place. (Also, a minor fix to the preprocessor rules for integer literals while I'm here.) llvm-svn: 186903
* Fixed implementation of C89 6.5.7 p3.Enea Zaffanella2013-07-221-0/+5
| | | | | | Warning should be emitted only for InitListExpr nodes. llvm-svn: 186859
* This test was missing its -verify argument.Aaron Ballman2013-07-221-1/+1
| | | | llvm-svn: 186847
* Implement the part of C89 6.5.7 p3 requiring a constant initializer listEnea Zaffanella2013-07-221-0/+4
| | | | | | when initializing aggregate/union types, no matter if static or not. llvm-svn: 186817
* Test contents were somehow duplicated, resulting in any testcase that fails ↵Aaron Ballman2013-07-181-23/+0
| | | | | | automatically failing twice. Removing the duplicates. llvm-svn: 186590
* Removed a parameter from handleAttrWithMessage to make it more consistent ↵Aaron Ballman2013-07-182-1/+6
| | | | | | with other attribute handlers, as well as other attribute error messages. Added missing test cases for the unavailable attribute, and updated the deprecated test case. llvm-svn: 186578
* Make Expr::isConstantInitializer match IRGen.Eli Friedman2013-07-161-0/+3
| | | | | | | | | | Sema needs to be able to accurately determine what will be emitted as a constant initializer and what will not, so we get accurate errors in C and accurate -Wglobal-constructors warnings in C++. This makes Expr::isConstantInitializer match CGExprConstant as closely as possible. llvm-svn: 186464
* ARM: implement low-level intrinsics for the atomic exclusive operations.Tim Northover2013-07-162-5/+66
| | | | | | | | | | | | This adds three overloaded intrinsics to Clang: T __builtin_arm_ldrex(const volatile T *addr) int __builtin_arm_strex(T val, volatile T *addr) void __builtin_arm_clrex() The intent is that these do what users would expect when given most sensible types. Currently, "sensible" translates to ints, floats and pointers. llvm-svn: 186394
* Limit number of bits in size representation so that bit size fit 64 bits.Serge Pavlov2013-07-162-3/+8
| | | | | | This fixes PR8256 and some others. llvm-svn: 186385
* Merge attributes on typedef decls.Eli Friedman2013-07-161-0/+4
| | | | | | | | | Not completely sure this is right, but it's clearly better than what we did before this commit (effectively dropping the attribute). <rdar://problem/14413117> llvm-svn: 186373
* Fix Sema for compares with _Atomic vars.Eli Friedman2013-07-081-0/+13
| | | | | | | | | | | | | | | | Use UsualArithmeticConversions unconditionally in analysis of comparisons and conditional operators: the method performs the usual arithmetic conversions if both sides are arithmetic, and usual unary conversions if they are not. This is just a cleanup for conditional operators; for comparisons, it fixes the issue that we would try to check isArithmetic() on an atomic type. Also, fix GetExprRange() in SemaChecking.cpp so it deals with variables of atomic type correctly. Fixes PR15537. llvm-svn: 185857
* Sema: Do not merge new decls with invalid, old declsDavid Majnemer2013-07-071-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Sema::MergeFunctionDecl attempts merging two decls even if the old decl is invalid. This can lead to interesting circumstances where we successfully merge the decls but the result makes no sense. Take the following for example: template <typename T> int main(void); int main(void); Sema will not consider these to be overloads of the same name because main can't be overloaded, which means that this must be a redeclaration. In this case the templated decl is compatible with the non-templated decl allowing the Sema::CheckFunctionDeclaration machinery to move on and do bizarre things like setting the previous decl of a non-templated decl to a templated decl! The way I see it, we should just bail from MergeFunctionDecl if the old decl is invalid. This fixes PR16531. llvm-svn: 185779
* Add test for r185584.Roman Divacky2013-07-041-0/+1
| | | | llvm-svn: 185668
* Add 'not' to commands that are expected to fail.Rafael Espindola2013-07-044-6/+6
| | | | | | | This is at least good documentation, but also opens the possibility of using pipefail. llvm-svn: 185652
* Add test for PR4997. This has been fixed for a while.Richard Smith2013-07-041-0/+1
| | | | llvm-svn: 185614
* Add support for TF/TC modes available on eg. PowerPC64.Roman Divacky2013-07-031-0/+9
| | | | llvm-svn: 185578
* Teach -Wunsequenced that the side-effects of a function evaluation are sequencedRichard Smith2013-06-301-0/+3
| | | | | | | | | before the value computation of the result. In C, this is implied by there being a sequence point after their evaluation, and in C++, it's implied by the side-effects being sequenced before the expressions and statements in the function body. llvm-svn: 185282
* Reinstate r185229, reverted in r185256, with a tweak: further ignore theRichard Smith2013-06-301-0/+15
| | | | | | | | | | | | | | | | | | | | | | | standard's rule that an extern "C" declaration conflicts with any entity in the global scope with the same name. Now we only care if the global scope entity is a variable declaration (and so might have the same mangled name as the extern "C" declaration). This has been reported as a standard defect. Original commit message: PR7927, PR16247: Reimplement handling of matching extern "C" declarations across scopes. When we declare an extern "C" name that is not a redeclaration of an entity in the same scope, check whether it redeclares some extern "C" entity from another scope, and if not, check whether it conflicts with a (non-extern-"C") entity in the translation unit. When we declare a name in the translation unit that is not a redeclaration, check whether it conflicts with any extern "C" entities (possibly from other scopes). llvm-svn: 185281
* Revert r185229 as it breaks compilation of <windows.h>Timur Iskhodzhanov2013-06-291-15/+0
| | | | llvm-svn: 185256
* PR7927, PR16247: Reimplement handling of matching extern "C" declarationsRichard Smith2013-06-281-0/+15
| | | | | | | | | | | | | | | across scopes. When we declare an extern "C" name that is not a redeclaration of an entity in the same scope, check whether it redeclares some extern "C" entity from another scope, and if not, check whether it conflicts with a (non-extern-"C") entity in the translation unit. When we declare a name in the translation unit that is not a redeclaration, check whether it conflicts with any extern "C" entities (possibly from other scopes). llvm-svn: 185229
* PR16467: Teach -Wunsequenced that in C11 (unlike C++11), an assignment'sRichard Smith2013-06-261-0/+85
| | | | | | | | side-effect is not sequenced before its value computation. Also fix a mishandling of ?: expressions where the condition is constant that was exposed by the tests for this. llvm-svn: 185035
* Make this test properly test both things it's trying to test.Richard Smith2013-06-251-0/+3
| | | | llvm-svn: 184887
* Fix null pointer dereference if we redeclare an unprototyped function. Patch byRichard Smith2013-06-251-1/+7
| | | | | | WenHan Gu! llvm-svn: 184875
* [AST] Introduce a new DecayedType sugar nodeReid Kleckner2013-06-241-0/+10
| | | | | | | | | | | | | | The goal of this sugar node is to be able to look at an arbitrary FunctionType and tell if any of the parameters were decayed from an array or function type. Ultimately this is necessary to implement Microsoft's C++ name mangling scheme, which mangles decayed arrays differently from normal pointers. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D1014 llvm-svn: 184763
* Comment parsing: allow "\param ..." to describe variadic argumentsDmitri Gribenko2013-06-242-0/+30
| | | | | | | | Original patch by Fariborz Jahanian; extended by me. Fixes rdar://14124644 llvm-svn: 184688
* Documentation parsing: recognize \relates, \related, \relatesonly, \relatedonlyDmitri Gribenko2013-06-231-0/+19
| | | | | | | so that -Wdocumentation-unknown-command does not warn on these commands. Fixes PR16092. llvm-svn: 184676
* Comment parsing: followup to r184610: allow multiple \returnsDmitri Gribenko2013-06-221-4/+4
| | | | | | | | | Remove unneeded member in CommentSema, add a test for the XML schema (the schema already allowed multiple paragraphs in <ResultDiscussion>, but there were no tests for that), fix HTML generation (it is not allowed to have <p> inside <dl>). llvm-svn: 184652
* [document parsing]: Allow multiple adjacent \return and the likeFariborz Jahanian2013-06-211-4/+0
| | | | | | | commands. Render them properly in XML output. // rdar://14207725 llvm-svn: 184610
* Fix a crash with __flaot128 noticed by Eli.Nico Weber2013-06-201-1/+12
| | | | llvm-svn: 184498
* Lazily provide a __float128 dummy type in -std=gnu++11 mode.Nico Weber2013-06-201-0/+13
| | | | | | This is needed to parse libstdc++ 4.7's type_traits, see PR13530. llvm-svn: 184476
* documentation parsing: patch to make @class work forFariborz Jahanian2013-06-191-0/+44
| | | | | | | class templates; and similarly, @function works for function templates. // rdar://14124702 llvm-svn: 184329
* Revert r184249, "doc. parsing: Allow parameter name "..." for variadic ↵NAKAMURA Takumi2013-06-191-19/+0
| | | | | | | | | | | functions/methods." It crashes in the case; /// Without any "param"s in the description. int printf(const char *format, ...); llvm-svn: 184283
* doc. parsing: Allow parameter name "..." for variadic functions/methods.Fariborz Jahanian2013-06-181-0/+19
| | | | | | // rdar://14124644 llvm-svn: 184249
* Correctly compute the index of the first string format argument when decidingEli Friedman2013-06-181-0/+10
| | | | | | whether to emit a -Wformat-security warning. <rdar://problem/14178260>. llvm-svn: 184214
* size_t on Darwin AAPCS targets is "unsigned long". <rdar://problem/14136459>Bob Wilson2013-06-181-0/+12
| | | | | | | | Some embedded targets use ARM's AAPCS with iOS header files that define size_t as unsigned long, which conflicts with the usual AAPCS definition of size_t as unsigned int. llvm-svn: 184171
* Clean up empty struct/union recognition.Serge Pavlov2013-06-171-4/+17
| | | | | | | | | Make use of getTypeSizeInChars to detect structs/unions of zero size. It allows more accurate detection of types of zero size. It however has a side effect - sequence of used types may change, that is why the test 'override-layout' was modified. llvm-svn: 184088
* Allow clang to build __clear_cache on ARM.Rafael Espindola2013-06-131-0/+5
| | | | | | | | | __clear_cache is special. It needs no signature, but is a real function in compiler_rt or libgcc. Patch by Andrew Turner. llvm-svn: 183926
* More for PR12457: fix handling of __builtin_isinf_sign and test.Richard Smith2013-06-131-0/+7
| | | | llvm-svn: 183890
* Towards PR12457: constant expression evaluation support for ↵Richard Smith2013-06-131-0/+30
| | | | | | __builtin_parity{,l,ll}, __builtin_ffs{,l,ll}, and __builtin_fpclassify. llvm-svn: 183889
* Fix part of PR12457. Patch by Justin Bogner!Richard Smith2013-06-131-1/+28
| | | | llvm-svn: 183886
* Add -Wdeprecated warnings and fixits for things deprecated in C++11:Richard Smith2013-06-131-2/+2
| | | | | | | | | - 'register' storage class - dynamic exception specifications Only the former check is enabled by default for now (the latter might be quite noisy). llvm-svn: 183881
* Tweak r183791 so we don't print a note without a source location.Eli Friedman2013-06-111-0/+16
| | | | llvm-svn: 183803
* Add a test case for blocks taking an array typedefReid Kleckner2013-06-081-0/+11
| | | | | | | r183614 was failing because va_list on some platforms is defined in a similar manner. This test fails on Windows with r183614 applied. llvm-svn: 183617
* Revert "[Sema] Make FunctionType's TSI use unadjusted argument types"Reid Kleckner2013-06-081-5/+0
| | | | | | | | | This reverts commit r183614. It broke test/Sema/block-printf-attribute-1.c on non-Windows platforms, and the fix is not trivial. llvm-svn: 183616
* [Sema] Make FunctionType's TSI use unadjusted argument typesReid Kleckner2013-06-081-0/+5
| | | | | | | | | | | | | | | | This helps preserve the type-as-written in the AST, which we need for MSVC mangling. In particular, we need to preserve the types of array parameters in function pointer types. The essence of this change is: - QualType ArgTy = Param->getType(); + QualType ArgTy = Param->getTypeSourceInfo()->getType(); ... followed by the adjustment in ActOnFunctionDeclarator(). Differential Revision: http://llvm-reviews.chandlerc.com/D883 llvm-svn: 183614
* Recognition of empty structures and unions is moved to semantic stageSerge Pavlov2013-06-083-1/+70
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D586 llvm-svn: 183609
OpenPOWER on IntegriCloud