summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Analysis: Add support for MS specific printf format specifiersDavid Majnemer2013-08-211-0/+9
| | | | | | | | | | | | | | Summary: Adds support for %I, %I32 and %I64. Reviewers: hans, jordan_rose, rnk, majnemer Reviewed By: majnemer CC: cfe-commits, cdavis5x Differential Revision: http://llvm-reviews.chandlerc.com/D1456 llvm-svn: 188937
* Tweak gnu-flags.c test for z, where globals have 2-byte alignment by defaultRichard Sandiford2013-08-211-1/+7
| | | | llvm-svn: 188905
* Remove Extension warning for GNU local labels.Eli Friedman2013-08-201-18/+2
| | | | | | | | | We generally don't warn about extensions involving keywords reserved for the implementation, so we shouldn't warn here either: the standard doesn't require it, and it doesn't provide useful information to the user. llvm-svn: 188840
* Add more specific flags for misc GNU extensions.Eli Friedman2013-08-201-0/+98
| | | | | | | | | | | This adds the following as subgroups of -Wgnu: -Wgnu-alignof-expression, -Wgnu-case-range, -Wgnu-complex-integer, -Wgnu-conditional-omitted-operand, -Wgnu-empty-initializer, -Wgnu-label-as-value, -Wgnu-local-label, and -Wgnu-statement-expression, Patch by Peter Lewis. llvm-svn: 188839
* Handle init lists and _Atomic fields.Eli Friedman2013-08-191-0/+6
| | | | | | Fixes PR16931. llvm-svn: 188718
* Refactor all diagnosing of TypoCorrections through a common function, inRichard Smith2013-08-171-1/+1
| | | | | | | preparation for teaching this function how to diagnose a correction that includes importing a module. llvm-svn: 188602
* Fix implementation of C11 6.2.7/4 and C++11 [dcl.array]p3:Richard Smith2013-08-131-0/+24
| | | | | | | | | | | | | When a local extern declaration redeclares some other entity, the type of that entity is merged with the prior type if the prior declaration is visible (in C) or is declared in the same scope (in C++). - Make LookupRedeclarationWithLinkage actually work in C++, use it in the right set of cases, and make it track whether it found a shadowed declaration. - Track whether we found a declaration in the same scope (for C++) including across serialization and template instantiation. llvm-svn: 188307
* Fix alignof computation of large arrays on x86_64.Rafael Espindola2013-08-081-10/+0
| | | | | | | | | | | We were exposing the extra alignment given to large arrays. The new behavior matches gcc, which is a good thing since this is a gcc extension. Thanks to Joerg Sonnenberger for noticing it. While at it, centralize the method description in the .h file. llvm-svn: 187999
* Emit an error for enum increments and decrements in C++ mode.Richard Trieu2013-08-081-0/+13
| | | | | | Fixes PR16394. llvm-svn: 187955
* AArch64: initial NEON supportTim Northover2013-08-011-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch by Ana Pazos - Completed implementation of instruction formats: AdvSIMD three same AdvSIMD modified immediate AdvSIMD scalar pairwise - Completed implementation of instruction classes (some of the instructions in these classes belong to yet unfinished instruction formats): Vector Arithmetic Vector Immediate Vector Pairwise Arithmetic - Initial implementation of instruction formats: AdvSIMD scalar two-reg misc AdvSIMD scalar three same - Intial implementation of instruction class: Scalar Arithmetic - Initial clang changes to support arm v8 intrinsics. Note: no clang changes for scalar intrinsics function name mangling yet. - Comprehensive test cases for added instructions To verify auto codegen, encoding, decoding, diagnosis, intrinsics. llvm-svn: 187568
* err_attribute_missing_parameter_name has been replaced by ↵Aaron Ballman2013-07-301-2/+2
| | | | | | err_attribute_argument_type. llvm-svn: 187420
* Replacing err_attribute_argument_not_int with err_attribute_not_type_attrAaron Ballman2013-07-304-4/+4
| | | | llvm-svn: 187419
* err_attribute_not_string has been subsumed by err_attribute_argument_type.Aaron Ballman2013-07-306-8/+8
| | | | llvm-svn: 187400
* Refactor some attributes to use checkFunctionOrMethodArgumentIndex instead ↵Aaron Ballman2013-07-303-1/+4
| | | | | | of using custom logic. No functional changes intended. llvm-svn: 187398
* Remove assert header dependency in testDavid Blaikie2013-07-291-5/+3
| | | | llvm-svn: 187387
* Support for Thread Safety Analysis in CDavid Blaikie2013-07-291-0/+125
| | | | | | Patch by Ethan Jackson. llvm-svn: 187365
* Tighten type-checking for vector attributes.Eli Friedman2013-07-261-0/+8
| | | | | | Based on patch by Yunzhong Gao. llvm-svn: 187176
* 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
OpenPOWER on IntegriCloud