summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Add back a check removed in r226436David Majnemer2015-01-191-0/+3
| | | | | | | It shouldn't have been removed, the code which replaced it didn't cover this case. llvm-svn: 226442
* Sema: Variable definitions cannot be __attribute__((alias))David Majnemer2015-01-191-19/+2
| | | | | | | | | | | | | | | | | | | | Things that are OK: extern int var1 __attribute((alias("v1"))); static int var2 __attribute((alias("v2"))); Things that are not OK: int var3 __attribute((alias("v3"))); extern int var4 __attribute((alias("v4"))) = 4; We choose to accpet: struct S { static int var5 __attribute((alias("v5"))); }; This code causes assertion failues in GCC 4.8 and ICC 13.0.1, we have no reason to reject it. This partially fixes PR22217. llvm-svn: 226436
* [x86] Teach Sema to check size of comparison immediate on avx512 cmpps/cmppd ↵Craig Topper2015-01-191-0/+14
| | | | | | buitins. llvm-svn: 226422
* PR 20146Nathan Sidwell2015-01-151-0/+6
| | | | | | reject CV void return type on C definitions per 6.9.1/3 llvm-svn: 226178
* Sema: Relax parsing of '#' in constraintsDavid Majnemer2015-01-141-1/+1
| | | | llvm-svn: 225942
* Sema: Check type compatibility with the most recent decl when mergingDavid Majnemer2015-01-141-2/+6
| | | | | | | | | | We would check the type information from the declaration found by lookup but we would neglect checking compatibility with the most recent declaration. This would make it possible for us to not correctly diagnose inconsistencies with declarations which were made in a different scope. llvm-svn: 225934
* Sema: An extern declaration can't be a redeclaration of a parameterDavid Majnemer2015-01-141-0/+4
| | | | | | | | | | | | In the following: void f(int x) { extern int x; } The second declaration of 'x' shouldn't be considered a redeclaration of the parameter. This is a different approach to r225780. llvm-svn: 225875
* Revert "Sema: An extern declaration can't be a redeclaration of a parameter"David Majnemer2015-01-131-4/+0
| | | | | | | This reverts commit r225780, we can't compile line 181 in sanitizer_platform_limits_posix.cc with this commit. llvm-svn: 225781
* Sema: An extern declaration can't be a redeclaration of a parameterDavid Majnemer2015-01-131-0/+4
| | | | | | | | | | In the following: void f(int x) { extern int x; } The second declaration of 'x' shouldn't be considered a redeclaration of the parameter. llvm-svn: 225780
* Basic: Numeric constraints are multidigitDavid Majnemer2015-01-111-0/+7
| | | | | | | Clang would treat the digits in an "11m" input constraint separately as if it was handling constraint 1 twice instead of constraint 11. llvm-svn: 225606
* Basic: [asmSymbolicName] follows the same rule as numbers in asm inputsDavid Majnemer2015-01-111-0/+7
| | | | | | | | | Input constraints like "0" and "[foo]" should be treated the same when it comes to their corresponding output constraint. This fixes PR21850. llvm-svn: 225605
* Basic: The asm constraint '#m' isn't valid, reject itDavid Majnemer2015-01-111-0/+7
| | | | llvm-svn: 225603
* Basic: The asm constraint '+#r' isn't valid, reject itDavid Majnemer2015-01-111-0/+6
| | | | llvm-svn: 225600
* Sema: The asm constraint '+&m' isn't valid, reject itDavid Majnemer2015-01-101-0/+6
| | | | | | Don't permit '+&m' to make it to CodeGen, it's invalid. llvm-svn: 225586
* Fix test from my previous commitOlivier Goffart2015-01-091-2/+2
| | | | | | (I should have re-run the test after running clang-format) llvm-svn: 225515
* Fix crash in typo correction while correcting enum within a struct in COlivier Goffart2015-01-091-0/+11
| | | | llvm-svn: 225513
* Handle OpaqueValueExprs more intelligently in the TransformTypos treeKaelyn Takata2015-01-071-0/+3
| | | | | | | | | | | | transform. Also diagnose typos in the initializer of an invalid C++ declaration. Both issues were hit using the same line of test code, depending on whether the code was treated as C or C++. Fixes PR22092. llvm-svn: 225389
* R600: Handle amdgcn tripleTom Stellard2015-01-061-1/+1
| | | | | | For now there is no difference between amdgcn and r600. llvm-svn: 225294
* Sema: analyze I,J,K,M,N,O constraintsSaleem Abdulrasool2015-01-061-0/+105
| | | | | | | | | | Add additional constraint checking for target specific behaviour for inline assembly constraints. We would previously silently let all arguments through for these constraints. In cases where the constraints were violated, we could end up failing to select instructions and triggering assertions or worse, silently ignoring instructions. llvm-svn: 225244
* Crash less enthusiasticially on _Atomic or __restrict__ on invalid types.Nico Weber2015-01-041-4/+8
| | | | | | | | | | Many places in Sema cannot handle isNull() types. This is fine, because in most places the type building code recovers by falling back to IntTy. In GetFullTypeForDeclarator(), this is done at the end of the getNumTypeObjects() loop body. This function calls BuildQualifiedType() before this fallback is done though, so it explicitly needs to check for isNull() types. llvm-svn: 225124
* Sema: Forbid inconsistent constraint alternativesDavid Majnemer2014-12-291-0/+7
| | | | | | Verify that asm constraints have the same number of alternatives llvm-svn: 224911
* [x86] Add range checking to the constant argument of cmpps/pd/ss/sd builtinas.Craig Topper2014-12-271-0/+20
| | | | llvm-svn: 224880
* Rename test.cc files to test.cpp.Nico Weber2014-12-221-0/+0
| | | | | | | The lit.cfg files only add .cpp to suffixes, so these tests used to never run, oops. (Also tweak to of these tests in minor ways to make the actually pass.) llvm-svn: 224718
* Simplify test for rdar://19256338Fariborz Jahanian2014-12-221-12/+4
| | | | | | (from patch r224549). llvm-svn: 224713
* [c Sema]. Patch fixes pointer-bool-conversion warning on C codeFariborz Jahanian2014-12-181-1/+15
| | | | | | | | when source range is incorrect causing the warning to be issued when it should not because expression is in a macro. rdar://19256338 llvm-svn: 224549
* Adding a -Wunused-value warning for expressions with side effects used in an ↵Aaron Ballman2014-12-174-8/+26
| | | | | | unevaluated expression context, such as sizeof(), or decltype(). Also adds a similar warning when the expression passed to typeid() *is* evaluated, since it is equally likely that the user would expect the expression operand to be unevaluated in that case. llvm-svn: 224465
* Sema: Cleanup and improve string-plus-char checking.Daniel Marjamaki2014-12-151-0/+15
| | | | | | Patch by Anders Rönnholm llvm-svn: 224268
* Implement the __builtin_call_with_static_chain GNU extension.Peter Collingbourne2014-12-121-0/+11
| | | | | | | | | | | | | | | | The extension has the following syntax: __builtin_call_with_static_chain(Call, Chain) where Call must be a function call expression and Chain must be of pointer type This extension performs a function call Call with a static chain pointer Chain passed to the callee in a designated register. This is useful for calling foreign language functions whose ABI uses static chain pointers (e.g. to implement closures). Differential Revision: http://reviews.llvm.org/D6332 llvm-svn: 224167
* Do not warn on keyword undefSerge Pavlov2014-12-121-2/+0
| | | | | | | #undef a keyword is generally harmless but used often in configuration scripts. Also added tests that I forgot to include to commit in r223114. llvm-svn: 224100
* When checking for nonnull parameter attributes, also check the ParmVarDecl ↵Aaron Ballman2014-12-111-0/+12
| | | | | | since the attribute may reside there, instead of just on the FunctionDecl. Fixes PR21668. llvm-svn: 224039
* Emit warning if define or undef reserved identifier or keyword.Serge Pavlov2014-12-111-0/+2
| | | | | | Recommit of r223114, reverted in r223120. llvm-svn: 224012
* Teach EvaluatedExprVisitor that the condition and unselected branches of aRichard Smith2014-12-031-0/+3
| | | | | | _Generic expression are unevaluated. llvm-svn: 223266
* PR21706: -Wunsequenced was missing warnings when leaving a sequenced region ↵Richard Smith2014-12-031-2/+7
| | | | | | that contained side effects. llvm-svn: 223184
* Reverted r223114, it caused failure on on clang-native-arm-cortex-a9.Serge Pavlov2014-12-021-2/+0
| | | | llvm-svn: 223120
* Emit warning if define or undef reserved identifier or keyword.Serge Pavlov2014-12-021-0/+2
| | | | | | | | | | | | | | | | | | | | | Summary: This change implements warnings if macro name is identical to a keyword or reserved identifier. The warnings are different depending on the "danger" of the operation. Defining macro that replaces a keyword is on by default. Other cases produce warning that is off by default but can be turned on using option -Wreserved-id-macro. This change fixes PR11488. Reviewers: rnk Reviewed By: rnk Subscribers: rnk, cfe-commits Differential Revision: http://reviews.llvm.org/D6194 llvm-svn: 223114
* Create a new 'flag_enum' attribute.Alexis Hunt2014-11-281-0/+73
| | | | | | | | | | | This attribute serves as a hint to improve warnings about the ranges of enumerators used as flag types. It currently has no working C++ implementation due to different semantics for enums in C++. For more explanation, see the docs and testcases. Reviewed by Aaron Ballman. llvm-svn: 222906
* Force the correction of delayed typos in casts in non-C++ code.Kaelyn Takata2014-11-241-0/+5
| | | | | | | Fixes PR21656, which is fallout from r222551 caused by an untested/missed code path. llvm-svn: 222694
* Implement -Wcast-qual, fixing #13772.Roman Divacky2014-11-211-0/+29
| | | | | | Many thanks to dblaikie for his advices and suggestions! llvm-svn: 222568
* Enable ActOnIdExpression to use delayed typo correction for non-C++ codeKaelyn Takata2014-11-211-0/+6
| | | | | | when calling DiagnoseEmptyLookup. llvm-svn: 222551
* Add the exception for strings in logical and expressions to -Wstring-conversionRichard Trieu2014-11-191-0/+17
| | | | | | for C code. llvm-svn: 222327
* [Sema] Patch to issue warning on comparing parameters withFariborz Jahanian2014-11-181-0/+58
| | | | | | | | | | | nonnull attribute when comparison is always true/false. Original patch by Steven Wu. I have added extra code to prevent issuing of warning when the nonnull parameter is modified prior to the comparison. This addition prevents false positives in the most obvious cases. There may still be false positive warnings in some cases (as one of my tests indicates), but benefit far outweighs such cases. rdar://18712242 llvm-svn: 222264
* [Sema]. Warn when logical expression is a pointerFariborz Jahanian2014-11-142-1/+85
| | | | | | | which evaluates to true. rdar://18716393. Reviewed by Richard Trieu llvm-svn: 222009
* -Wsentinel: Suggest nullptr in C++11 instead of NULLReid Kleckner2014-11-131-1/+12
| | | | llvm-svn: 221945
* Remove this test too.Fariborz Jahanian2014-11-111-0/+0
| | | | llvm-svn: 221715
* Revert r221702 until I address Richard Trieu'sFariborz Jahanian2014-11-112-85/+1
| | | | | | comments. llvm-svn: 221714
* Patch to warn when logical evaluation of operand evalutes to a true value;Fariborz Jahanian2014-11-112-1/+85
| | | | | | | That this is a c-only patch. c++ already has this warning. This addresses rdar://18716393 llvm-svn: 221702
* Move the no-prototype calling conv check after decl mergingReid Kleckner2014-11-031-0/+5
| | | | | | | | | | | Now we don't warn on this code: void __stdcall f(void); void __stdcall f(); My previous commit regressed this functionality because I didn't update the relevant test case which used a definition. llvm-svn: 221188
* Don't diagnose no-prototype callee-cleanup function definitionsReid Kleckner2014-11-032-6/+12
| | | | | | | | | | | | We already have a warning on the call sites of code like this: void f() { } void g() { f(1, 2, 3); } t.c:2:21: warning: too many arguments in call to 'f' We can limit ourselves to diagnosing unprototyped forward declarations of f to cut down on noise. llvm-svn: 221184
* This patch reverts r220496 which issues warning on comparing Fariborz Jahanian2014-11-031-25/+0
| | | | | | | | parameters with nonnull attribute when comparison is always true/false. Patch causes false positive when parameter is modified in the function. llvm-svn: 221163
* Don't dllimport inline functions when targeting MinGW (PR21366)Hans Wennborg2014-11-031-7/+20
| | | | | | | | | | | | It turns out that MinGW never dllimports of exports inline functions. This means that code compiled with Clang would fail to link with MinGW-compiled libraries since we might try to import functions that are not imported. To fix this, make Clang never dllimport inline functions when targeting MinGW. llvm-svn: 221154
OpenPOWER on IntegriCloud