[LLVMbugs] [Bug 18564] New: Redefinition of identical typedefs fails

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jan 20 17:16:10 PST 2014


            Bug ID: 18564
           Summary: Redefinition of identical typedefs fails
           Product: clang
           Version: 3.3
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: fluffmail at f-m.fm
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

>From C11 ยง6.7(3): "a typedef name may be redefined to denote the same type as
it currently does, provided that type is not a variably modified type."

So we should be able to redundantly duplicate the same typedef into a file with
no problem. But clang seems to have trouble identifying that duplicated
typedefs are duplicates. Sample code:

typedef struct {
    int a;
    double b;
} ab;

typedef struct {
    int a;
    double b;
} ab;

int main(){}



> clang --std=c11 bug.c

bug.c:9:3: error: typedef redefinition with different types ('struct ab' vs
'struct ab')
} ab;
bug.c:4:3: note: previous definition is here
} ab;
1 error generated.


You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140121/4f7403bb/attachment.html>

More information about the llvm-bugs mailing list