[LLVMbugs] [Bug 4204] New: clang rejects valid redeclaration of function declared in nested scope

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue May 12 14:14:15 PDT 2009


http://llvm.org/bugs/show_bug.cgi?id=4204

           Summary: clang rejects valid redeclaration of function declared
                    in nested scope
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Semantic Analyzer
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: daniel at zuster.org
                CC: llvmbugs at cs.uiuc.edu


If I am not mistaken, clang is incorrect to reject the following program:
--
ddunbar at lordcrumb:tmp$ cat t.c
void f0(void) {
  extern void g0(void);
}
g0(void) {}
ddunbar at lordcrumb:tmp$ gcc -std=gnu89 -c t.c
t.c:4: warning: conflicting types for 'g0'
t.c:2: warning: previous declaration of 'g0' was here
ddunbar at lordcrumb:tmp$ clang -std=gnu89 -c t.c
t.c:4:1: error: conflicting types for 'g0'
g0(void) {}
^
t.c:2:15: note: previous declaration is here
  extern void g0(void);
              ^
2 diagnostics generated.
--


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list