summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/knr-def-call.c
Commit message (Collapse)AuthorAgeFilesLines
* Revert r294910 and recommit r294861 and r294862 with a target triple to ↵Aaron Ballman2017-02-121-4/+10
| | | | | | hopefully appease the bots. llvm-svn: 294911
* Revert "Attributes on K&R C functions should not cause incompatible..."Renato Golin2017-02-121-6/+0
| | | | | | | | | | | | | | | | ...function type with a redeclaration having the same attribute. Fixing this introduced a secondary problem where we were assuming that K&R functions could not be attributed types when reporting old-style function definitions that are not preceded by a prototype." Also Revert "Hopefully fixes a compile error introduced by r294861." This reverts commit r294862, r294861, as they bork the ARM builds and haven't fix it back. Also, please, short commit titles, long commit decsriptions... llvm-svn: 294910
* Attributes on K&R C functions should not cause incompatible function type ↵Aaron Ballman2017-02-111-0/+6
| | | | | | | | with a redeclaration having the same attribute. Fixing this introduced a secondary problem where we were assuming that K&R functions could not be attributed types when reporting old-style function definitions that are not preceded by a prototype. This patch fixes PR31020. llvm-svn: 294861
* Improve some of the conversion warnings to fire on conversion to bool.David Blaikie2012-05-151-2/+2
| | | | | | | | | | | Moves the bool bail-out down a little in SemaChecking - so now -Wnull-conversion and -Wliteral-conversion can fire when the target type is bool. Also improve the wording/details in the -Wliteral-conversion warning to match the -Wconstant-conversion. llvm-svn: 156826
* Only warn in -Wliteral-conversion if the conversion loses informationMatt Beaumont-Gay2011-10-141-4/+2
| | | | llvm-svn: 141955
* Enhance the diagnostic for literal float -> int conversions to suggestChandler Carruth2011-04-101-2/+4
| | | | | | | | | | | | rewriting the literal when the value is integral. It is not uncommon to see code written as: const int kBigNumber = 42e5; Without any real awareness that this is no longer an ICE. The note helps automate and ease the process of fixing code that violates the warning. llvm-svn: 129243
* Implement a sub-group of -Wconversion: -Wliteral-conversion. ThisChandler Carruth2011-02-171-3/+3
| | | | | | | | | | | specifically targets literals which are implicitly converted, a those are more often unintended and trivial to fix. This can be especially helpful for diagnosing what makes 'const int x = 1e6' not an ICE. Original patch authored by Jim Meehan with contributions from other Googlers and a few cleanups from myself. llvm-svn: 125745
* Look through the address-of operator to find the function beingDouglas Gregor2010-10-251-0/+1
| | | | | | called. Fixes another aspect of PR8314. llvm-svn: 117308
* When we're calling a function that we know based on its K&R-styleDouglas Gregor2010-10-251-1/+12
| | | | | | | | function definition, we should still use a prototype to type-check and convert the function arguments, if such a prototype exists. Fixes PR8314. llvm-svn: 117305
* make clang print types as "const int *" instead of "int const*",Chris Lattner2010-09-051-1/+1
| | | | | | | which is should have done from the beginning. As usual, the most fun with this sort of change is updating all the testcases. llvm-svn: 113090
* Allow a looser form of compatibility checking (which ignoresDouglas Gregor2010-07-291-0/+11
| | | | | | | qualifiers) when checking a K&R function definition against a previous prototype. Fixes <rdar://problem/8193107>. llvm-svn: 109751
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* When calling a function without a prototype for which we have aDouglas Gregor2009-04-021-2/+6
| | | | | | | definition, warn if there are too many/too few function call arguments. llvm-svn: 68318
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Implement GNU C semantics for K&R function definitions that follow aDouglas Gregor2009-03-061-1/+1
| | | | | | | | prototype of the same function, where the promoted parameter types in the K&R definition are not compatible with the types in the prototype. Fixes PR2821. llvm-svn: 66301
* C99 DR #316 implies that the function parameter types that are knownDouglas Gregor2009-02-251-0/+14
only from a function definition (that does not have a prototype) are only used to determine the compatible with other declarations of that same function. In particular, when referencing the function we pretend as if it does not have a prototype. Implement this behavior, which fixes PR3626. llvm-svn: 65460
OpenPOWER on IntegriCloud