summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Make sure we allow "#pragma options align=mac68k" in function-local ↵Eli Friedman2012-10-081-0/+12
| | | | | | contexts. <rdar://problem/12453134> llvm-svn: 165462
* Use a single note diagnostic for all the precedent/parentheses warnings.David Blaikie2012-10-081-3/+3
| | | | llvm-svn: 165384
* Expose __builtin_bswap16.Benjamin Kramer2012-10-062-4/+6
| | | | | | | GCC has always supported this on PowerPC and 4.8 supports it on all platforms, so it's a good idea to expose it in clang too. LLVM supports this on all targets. llvm-svn: 165362
* Changing line endings from Windows to Unix. No functional changes.Aaron Ballman2012-10-052-26/+26
| | | | llvm-svn: 165329
* Implement -Wshift-op-parentheses for: a << b + cDavid Blaikie2012-10-051-0/+12
| | | | | | | | | | | | This appears to be consistent with GCC's implementation of the same warning under -Wparentheses. Suppressing a << b + c for cases where 'a' is a user defined type for compatibility with C++ stream IO. Otherwise suggest parentheses around the addition or subtraction subexpression. (this came up when MSVC was complaining (incorrectly, so far as I can tell) about a perceived violation of this within the LLVM codebase, PR14001) llvm-svn: 165283
* Permanently end the whole "pragma got handled by the parser too early"Eli Friedman2012-10-041-0/+11
| | | | | | | mess by handling all pragmas which the parser touches uniformly. <rdar://problem/12248901>, etc. llvm-svn: 165195
* Splitting this test case into two because the behavior for the calling ↵Aaron Ballman2012-10-022-6/+6
| | | | | | convention code is target-specific. llvm-svn: 165016
* Allowing individual targets to determine whether a given calling convention ↵Aaron Ballman2012-10-025-5/+39
| | | | | | | | is allowed or ignored with warning. This allows for correct name mangling for x64 targets on Windows, which in turn allows for linking against the Win32 APIs. Fixes PR13782 llvm-svn: 165015
* availability in structured documents. TakesFariborz Jahanian2012-10-012-6/+6
| | | | | | care of comments by Dimitri and Doug. llvm-svn: 164957
* Move the 'find macro by spelling' infrastructure to the Preprocessor class andDmitri Gribenko2012-09-291-0/+7
| | | | | | | use it to suggest appropriate macro for __attribute__((deprecated)) in -Wdocumentation-deprecated-sync. llvm-svn: 164892
* Allow __builtin_bswap32/64 in constant expressions, like gcc does. Patch by ↵Richard Smith2012-09-282-0/+4
| | | | | | Tijl Coosemans! llvm-svn: 164841
* Make this test actually test somethingNico Weber2012-09-261-1/+1
| | | | llvm-svn: 164677
* Fix failing test/Sema/wchar.c on ARM.Hans Wennborg2012-09-251-0/+2
| | | | | | | | | | | Currently Sema/wchar.c fails because WCHAR_T_TYPE is defined as int, however on ARM wchar_t is unsigned int. This patch changes that, so this test passes for ARM. Patch by Joey Gouly! llvm-svn: 164598
* Replace an assertion with an error for empty __asm statements.Bob Wilson2012-09-241-0/+5
| | | | llvm-svn: 164551
* Change the wording of the extension warning fromDmitri Gribenko2012-09-242-5/+6
| | | | | | | | | > 'long long' is an extension when C99 mode is not enabled to > 'long long' is a C++11 extension while compiling in C++98 mode. llvm-svn: 164545
* Comment sema: warn when comment has \deprecated but declaration does not have aDmitri Gribenko2012-09-222-2/+64
| | | | | | | | | deprecation attribute ('deprecated', 'availability' or 'unavailable'). This warning is under a separate flag, -Wdocumentation-deprecated-sync, so it can be turned off easily while leaving other -Wdocumentation warnings on. llvm-svn: 164467
* Avoid multiple atomic builtin declaration.Abramo Bagnara2012-09-221-0/+14
| | | | llvm-svn: 164454
* Improvements to my patch in r164143 perFariborz Jahanian2012-09-202-47/+47
| | | | | | Richard's comments. // rdar://12202422 llvm-svn: 164316
* Include types when a definition's type differs from a prior declaration.David Blaikie2012-09-201-1/+1
| | | | | | | | | | | | | This is some really old code (took me a while to find the test cases) & the diagnostic text is slightly incorrect (it should really only apply to re/declarations/, redefinitions are an error regardless of whether the types match). Not sure if anyone cares about it, though. For now this just makes the diagnostic more clear in less obvious cases where the type of a declaration might not be explicitly written (eg: because it uses decltype) llvm-svn: 164313
* PR13881: Add -Wzero-length-array for zero length array extension, and move ↵Richard Smith2012-09-201-0/+1
| | | | | | it into -Wgnu. llvm-svn: 164272
* c: warn when an integer value comparison with anFariborz Jahanian2012-09-182-16/+165
| | | | | | | | integral expression have the obvious result. Patch reviewed by John McCall off line. // rdar://12202422 llvm-svn: 164143
* Per discussion on cfe-dev, remove -Wunique-enums entirely. ThereTed Kremenek2012-09-181-92/+0
| | | | | | | | is no compelling argument that this is a generally useful warning, and imposes a strong stylistic argument on code beyond what it was intended to find warnings in. llvm-svn: 164083
* Comment parsing: don't treat typedef to a typedef to a function as aDmitri Gribenko2012-09-151-0/+6
| | | | | | | | 'function-like' type that can be annotated with \param. Thanks to Eli Friedman for noticing! llvm-svn: 163985
* const _Atomic(T) is not an atomic type, so do not allow it as the type 'A' inRichard Smith2012-09-151-1/+6
| | | | | | | C11 7.17's atomic operations. GNU's __atomic_* builtins do allow const-qualified atomics, though (!!) so don't restrict those. llvm-svn: 163964
* Comment parsing: support the "\invariant" command.Dmitri Gribenko2012-09-141-0/+8
| | | | llvm-svn: 163905
* Comment parsing: handle \deprecated command. It is a block command, but itDmitri Gribenko2012-09-131-0/+13
| | | | | | | should be fine to use it without further explanations in the attached paragraph, so the warning about empty paragraph was turned off for it. llvm-svn: 163836
* Format strings: offer a fixit for Darwin's %D/%U/%O to ISO %d/%u/%o.Jordan Rose2012-09-131-22/+22
| | | | | | <rdar://problem/12061922> llvm-svn: 163772
* Format strings: %D, %U, and %O are valid on Darwin (same as %d, %u, %o).Jordan Rose2012-09-131-0/+64
| | | | | | | | | These will warn under -Wformat-non-iso, and will still be rejected outright on other platforms. <rdar://problem/12061922> llvm-svn: 163771
* clang/test: [PR8833] Introduce the feature "LP64" to suppress ↵NAKAMURA Takumi2012-09-122-0/+2
| | | | | | | | LLP64-incompatible tests. I think some of them could be rewritten to fit also LLP64. llvm-svn: 163699
* Teach -Wuninitialized to recognize __attribute__((analyzer_noreturn))Ted Kremenek2012-09-121-0/+23
| | | | | | | | | | | | | | | | | | for halting the propagation of uninitialized value tracking along a path. Unlike __attribute__((noreturn)), this attribute (which is used by clients of the static analyzer) can be used to annotate functions that essentially never return, but in rare cares may be allowed to return for (special) debugging purposes. This attribute has been shown in reducing false positives in the static analyzer by pruning false postives, and is equally applicable here. Handling this attribute in the CFG itself is another option, but this is not something all clients (e.g., possibly -Wunreachable-code) would want to see. Addresses <rdar://problem/12281583>. llvm-svn: 163681
* Comment parsing: handle non-builtin commands correctly. After semanticDmitri Gribenko2012-09-111-0/+5
| | | | | | | | | | | analysis registers a command, it becomes a "known" command for the lexer, since it has an ID. Having this freedom of choice to register a command is a good thing since BriefParser does not need this. But the parser should still invoke the correct semantic analysis method (actOnUnknownCommand) in this case. llvm-svn: 163646
* clang/test/Sema/format-strings-scanf.c: Relax a couple of expressions with ↵NAKAMURA Takumi2012-09-081-2/+2
| | | | | | | | | expected-warning-re to let matched for Win32 targets. - format specifies type 'wchar_t **' (aka 'int **') but the argument has type 'float *' - format specifies type 'wchar_t **' (aka 'unsigned short **') but the argument has type 'float *' llvm-svn: 163468
* Format strings: suggest %lld instead of %qd and %Ld with -Wformat-non-iso.Jordan Rose2012-09-082-7/+8
| | | | | | | As a corollary to the previous commit, even when an extension is available, we can still offer a fixit to the standard modifier. llvm-svn: 163453
* Format strings: %Ld isn't available on Darwin or Windows.Jordan Rose2012-09-084-23/+57
| | | | | | | | | This seems to be a GNU libc extension; we offer a fixit to %lld on these platforms. <rdar://problem/11518237> llvm-svn: 163452
* c: make __attribute__((unused)) transitive.Fariborz Jahanian2012-09-061-1/+13
| | | | | | | Don't warn if annotated decl is used inside another unused. // rdar://12233989 llvm-svn: 163329
* c error recovery. treat an invalid redeclarationFariborz Jahanian2012-09-051-0/+9
| | | | | | | | of a c-function for what it is. Otherwise, this func is treated as an overloadable c-function resulting in a crash much later. // rdar://11743706 llvm-svn: 163224
* Add -Wduplicate-enum warning. Clang will emit this warning when an implicitlyRichard Trieu2012-08-301-0/+92
| | | | | | | | | | | | | | | | initiated enum constant has the same value as another enum constant. For instance: enum test { A, B, C = -1, D, E = 1 }; Clang will warn that: A and D both have value 0 B and E both have value 1 A few exceptions are made to keep the noise down. Enum constants which are initialized to another enum constant, or an enum constant plus or minus 1 will not trigger this warning. Also, anonymous enums are not checked. llvm-svn: 162938
* Fix a crash in type merging with enum types.Eli Friedman2012-08-301-0/+4
| | | | llvm-svn: 162886
* Move the test for PR13720 from Sema/init.c to Sema/thread-specifier.c.Hans Wennborg2012-08-292-7/+7
| | | | | | Can't use __thread in init.c because it doesn't have a triple. llvm-svn: 162836
* The address of a TLS var is not compile-time constant (PR13720)Hans Wennborg2012-08-291-0/+7
| | | | | | | | | | | | This makes Clang produce an error for code such as: __thread int x; int *p = &x; The lvalue of a thread-local variable cannot be evaluated at compile time. llvm-svn: 162835
* Fix for assertion when solving unresolved templates.Rafael Espindola2012-08-281-0/+21
| | | | | | Patch by Magee, Josh. llvm-svn: 162737
* Comment diagnostics: for unresolved parameters, do not suggest parameter fixitDmitri Gribenko2012-08-242-15/+39
| | | | | | | | with parameter that is documented. Fixes PR13670, <rdar://problem/12155840>. llvm-svn: 162570
* Teach CFG that 'if (x & 0)' and 'if (x * 0)' is an unfeasible branch.Ted Kremenek2012-08-241-0/+9
| | | | | | Fixes <rdar://problem/11005770>. llvm-svn: 162545
* Comment semantic analysis: treat function typedefs as functions so that one canDmitri Gribenko2012-08-242-1/+30
| | | | | | | | use \param and \returns in documentation. Fixes PR13533. llvm-svn: 162507
* Comment parsing: parse "<blah" as an HTML tag only if "blah" is a known tagDmitri Gribenko2012-08-221-2/+2
| | | | | | | | | | name. This should reduce the amount of warning false positives about bad HTML in comments when the comment author intended to put a reference to a template. This change will also enable us parse the comment as intended in these cases. Fixes part 1 of PR13374. llvm-svn: 162407
* c: privide deprecated warning when __private_extern__ storageFariborz Jahanian2012-08-175-5/+6
| | | | | | | | specifier is unsed in a declaration; as it may not make the symbol local to linkage unit as intended. Suggest using "hidden" visibility attribute instead. // rdar://7703982 llvm-svn: 162138
* make this test case 64bit test. It fails due to Fariborz Jahanian2012-08-171-1/+1
| | | | | | 'int' vs. 'long' issue with i386. llvm-svn: 162125
* c: implement gcc's -Wbad-function-cast which warnsFariborz Jahanian2012-08-171-0/+47
| | | | | | | on unsafe cast of a c-function call. This is a C-only option. llvm-svn: 162109
* Define __builtin_ffs[ll] with a signed argument instead of unsigned.Benjamin Kramer2012-08-171-0/+5
| | | | | | GCC documents these as unsigned, but defines them as signed. llvm-svn: 162106
* Add support for "type safety" attributes that allow checking that 'void *'Dmitri Gribenko2012-08-174-0/+549
| | | | | | | | | | | | | | function arguments and arguments for variadic functions are of a particular type which is determined by some other argument to the same function call. Usecases include: * MPI library implementations, where these attributes enable checking that buffer type matches the passed MPI_Datatype; * for HDF5 library there is a similar usecase as MPI; * checking types of variadic functions' arguments for functions like fcntl() and ioctl(). llvm-svn: 162067
OpenPOWER on IntegriCloud