summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/predefined-function.c
Commit message (Collapse)AuthorAgeFilesLines
* Keep invalid functions as part of the ASTOlivier Goffart2016-06-161-3/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D19764 llvm-svn: 272962
* Whenever we complain about a failed initialization of a function orDouglas Gregor2010-04-221-1/+2
| | | | | | | | | | | | | | | | | method parameter, provide a note pointing at the parameter itself so the user does not have to manually look for the function/method being called and match up parameters to arguments. For example, we now get: t.c:4:5: warning: incompatible pointer types passing 'long *' to parameter of type 'int *' [-pedantic] f(long_ptr); ^~~~~~~~ t.c:1:13: note: passing argument to parameter 'x' here void f(int *x); ^ llvm-svn: 102038
* Improve diagnostics when we fail to convert from a source type to aDouglas Gregor2010-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | destination type for initialization, assignment, parameter-passing, etc. The main issue fixed here is that we used rather confusing wording for diagnostics such as t.c:2:9: warning: initializing 'char const [2]' discards qualifiers, expected 'char *' [-pedantic] char *name = __func__; ^ ~~~~~~~~ We're not initializing a 'char const [2]', we're initializing a 'char *' with an expression of type 'char const [2]'. Similar problems existed for other diagnostics in this area, so I've normalized them all with more precise descriptive text to say what we're initializing/converting/assigning/etc. from and to. The warning for the code above is now: t.c:2:9: warning: initializing 'char *' from an expression of type 'char const [2]' discards qualifiers [-pedantic] char *name = __func__; ^ ~~~~~~~~ Fixes <rdar://problem/7447179>. llvm-svn: 100832
* 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
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-9/+8
| | | | llvm-svn: 81346
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Adopt a more principled approach to invalid declarations:Douglas Gregor2009-02-161-3/+1
| | | | | | | | | | | | | | | | | | | | | | | - If a declaration is an invalid redeclaration of an existing name, complain about the invalid redeclaration then avoid adding it to the AST (we can still parse the definition or initializer, if any). - If the declaration is invalid but there is no prior declaration with that name, introduce the invalid declaration into the AST (for later error recovery). - If the declaration is an invalid redeclaration of a builtin that starts with __builtin_, we produce an error and drop the redeclaration. If it is an invalid redeclaration of a library builtin (e.g., malloc, printf), warn (don't error!) and drop the redeclaration. If a user attempts to define a builtin, produce an error and (if it's a library builtin like malloc) suggest -ffreestanding. This addresses <rdar://problem/6097585> and PR2892. However, PR3588 is still going to cause some problems when builtins are redeclared without a prototype. llvm-svn: 64639
* Make all the 'redefinition' diagnostics more consistent, and make the Chris Lattner2008-11-231-4/+4
| | | | | | "previously defined here" diagnostics all notes. llvm-svn: 59920
* remove expected-error from #if 0 section of code.Chris Lattner2008-11-211-2/+2
| | | | llvm-svn: 59772
* Fix PR2042. One remaining issue: we don't currently diagnoseChris Lattner2008-02-171-1/+3
| | | | | | | | | int foobar(int); int foobar() {} which requires ifdef'ing out a testcase in predefined-function.c. llvm-svn: 47236
* Sema::MergeFunctionDecl()...make sure diagnostic is accurate (wrt function ↵Steve Naroff2008-01-161-7/+7
| | | | | | declarations/definitions). Patch by Carl Lewis! llvm-svn: 46070
* Fix Sema::ActOnDeclarator() to call MergeFunctionDecl for function decls ↵Steve Naroff2008-01-091-0/+5
| | | | | | that aren't in scope. Since C functions are in a flat namespace, we need to give them special treatment (when compared with variables and typedefs). llvm-svn: 45789
* Fix ASTContext::typesAreCompatible to allow for int/enum compatibility (C99 ↵Steve Naroff2008-01-091-1/+5
| | | | | | | | 6.7.2.2p4). Fix Sema::MergeFunctionDecl to allow for function type compatibility (by using the predicate on ASTContext). Function types don't have to be identical to be compatible... llvm-svn: 45784
* Improve function decl merging, patch by Oliver Hunt!Chris Lattner2007-11-201-0/+29
llvm-svn: 44253
OpenPOWER on IntegriCloud