Граф коммитов

17 Коммитов

Автор SHA1 Сообщение Дата
Eli Friedman 7f0f5dce3a Check that the return type for function definitions is complete.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66027 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 07:30:59 +00:00
Douglas Gregor 04495c859f Improve merging of function declarations. Specifically:
- When we are declaring a function in local scope, we can merge with
    a visible declaration from an outer scope if that declaration
    refers to an entity with linkage. This behavior now works in C++
    and properly ignores entities without linkage.
  - Diagnose the use of "static" on a function declaration in local
    scope.
  - Diagnose the declaration of a static function after a non-static
    declaration of the same function.
  - Propagate the storage specifier to a function declaration from a
    prior declaration (PR3425)
  - Don't name-mangle "main"



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65360 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 01:23:02 +00:00
Douglas Gregor 18d76c2717 Note the Radar number that corresponds to PR3137
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63754 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-04 19:10:27 +00:00
Eli Friedman 0e8aaaf67b Test for PR3137.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63749 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-04 18:50:00 +00:00
Douglas Gregor be109b3e76 Handle any undeclared parameters in a K&R-style function with a
special action, inside function prototype scope. This avoids confusion
when we try to inject these parameters into the scope of the function
body before the function itself has been added to the surrounding
scope. Fixes <rdar://problem/6097326>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62849 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-23 16:23:13 +00:00
Chris Lattner 65ce04bef0 Merge function-return.c into function.c
Fix PR2790 by making a warning an EXTWARN instead of EXTENSION.
Add a new EXTENSION warning for "return (some void expression);"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61187 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 02:01:17 +00:00
Chris Lattner 777f07b6cd diagnose C99 6.9.1p5, C arguments in definitions that are lacking
a name.  This implements PR3208.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61127 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-17 07:32:46 +00:00
Chris Lattner 5f4a6829dc Make all the 'redefinition' diagnostics more consistent, and make the
"previously defined here" diagnostics all notes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59920 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 23:12:31 +00:00
Chris Lattner d658b562e8 Fix handling of implicit int, resolving PR2012 and reverting (and
subsuming) my patch for PR1999.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49251 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-05 06:32:51 +00:00
Chris Lattner 5280408ab3 Fix PR2042. One remaining issue: we don't currently diagnose
int foobar(int);
 int foobar() {}

which requires ifdef'ing out a testcase in predefined-function.c.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47236 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-17 19:31:09 +00:00
Eli Friedman f963339f63 Get rid of outdated code that masks type errors. Fixes PR2036.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47154 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 06:56:02 +00:00
Chris Lattner 99d724f6a3 Fix PR1999, by emitting a hard error only if an argument declarator is completely
missing.  Otherwise, it is an implicit int case, which is valid in c90 and invalid 
elsewhere, but accepted as an extension.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46938 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-10 23:08:00 +00:00
Chris Lattner 868d08f9e9 Fix a bogus test
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46602 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 06:06:29 +00:00
Steve Naroff 2565eeff7b Tighten up ASTContext::typesAreCompatible()...it needs to make sure the qualifiers match. The comment and C99 citation for this routine were correct...the code needed to conform to the comment/spec. This fixes the test added below.
Tightening up this routine forced tweaks to Sema::CheckSubtractionOperands() and Sema::CheckCompareOperands(). For example, they both need to operate on the unqualified pointee...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46522 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29 18:58:14 +00:00
Steve Naroff ba03eda159 Fix bz1950. ASTContext::functionTypesAreCompatible() needs to operate on the unqualified parameter types (per C99 6.7.5.3p15).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46472 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29 00:15:50 +00:00
Chris Lattner 1adb88370b Fix ASTContext::typesAreCompatible when analyzing a function type with
proto and function type without proto.  It would never call 
'functionTypesAreCompatible' because they have different type classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45952 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-14 05:45:46 +00:00
Chris Lattner 529bd02aff When promoting array to pointer for argument, don't lose type qualifiers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45510 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-02 22:50:48 +00:00