[LLVMbugs] [Bug 3680] New: anonymous union: invalid error & poor diagnostic

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Feb 27 09:01:49 PST 2009


           Summary: anonymous union: invalid error & poor diagnostic
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: parser
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: daniel at zuster.org
                CC: llvmbugs at cs.uiuc.edu

This is wrong:
ddunbar at 67-218-110-109:EH$ echo "struct {};" | xcc -fsyntax-only -x c -
echo "struct {};" | xcc -fsyntax-only -x c -
<stdin>:1:1: error: anonymous structs must be struct or union members
struct {};
1 diagnostic generated.
ddunbar at 67-218-110-109:EH$ echo "struct {};" | gcc -fsyntax-only -x c -
echo "struct {};" | gcc -fsyntax-only -x c -
<stdin>:1: warning: unnamed struct/union that defines no instances

And the diagnostic here is wrong (';' works too):
ddunbar at 67-218-110-109:Sema$ cat t.c
struct s0 {
  union {
    int a;
ddunbar at 67-218-110-109:Sema$ clang t.c
t.c:5:1: error: expected identifier or '('
1 diagnostic 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