[cfe-commits] r55158 - in /cfe/trunk: include/clang/AST/ASTContext.h lib/AST/ASTContext.cpp lib/Sema/SemaDecl.cpp lib/Sema/SemaExpr.cpp
Eli Friedman
eli.friedman at gmail.com
Sun Aug 24 00:07:01 PDT 2008
On Sat, Aug 23, 2008 at 11:38 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
> On Fri, Aug 22, 2008 at 11:47 AM, Daniel Dunbar <daniel at zuster.org> wrote:
>> I believe this or a related commit is causing regressions in the LLVM test
>> suite. My nightly tester (http://llvm.org/nightlytest/test.php?machine=308&night=7260)
>> is showing errors in
>> Benchmarks/Dhrystone/dry
>> Benchmarks/Dhrystone/fldry
>> Benchmarks/MallocBench/cfrac/cfrac
>> Benchmarks/McCat/18-imp/imp
>>
>> and I minimized the cfrac failure to the following test case:
>> --
>> typedef unsigned short posit;
>>
>> extern void palloc();
>>
>> void palloc(posit size) {
>> }
>> --
>> ddunbar at ddunbar2:cfrac$ clang Output/pops.E
>> Output/pops.E:5:6: error: conflicting types for 'palloc'
>> void palloc(posit size) {
>> ^
>> Output/pops.E:3:13: error: previous declaration is here
>> extern void palloc();
>> ^
>> 2 diagnostics generated.
>> --
>>
>> Can you investigate?
>
> For the testcase in question, my code is doing the right thing here;
> void f(short) and void f() are not compatible because short is a
> promotable integer type. Previously, we didn't check for that
> restriction. This issue is essentially just PR2586
> (http://llvm.org/bugs/show_bug.cgi?id=2586); I think it's just a
> matter of degrading the errors in Sema::MergeFunctionDecl to warnings,
> although it's possible there are non-obvious issues with that
> approach.
Correction: everything is working as intended for the given testcase,
but not for the aforementioned code. The real testcase is something
like the following:
int a();
int a(x) short x; {return x;}
We're quite incorrectly smashing this to pieces; the code is
completely correct. Roughly, the issue is that we aren't generating
the fake prototype correctly for the identifier list. I'll try to
throw together a fix soon.
-Eli
More information about the cfe-commits
mailing list