[LLVMbugs] [Bug 5692] New: clang rejects invalid code with wrong diagnostic

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat Dec 5 00:27:49 PST 2009


           Summary: clang rejects invalid code with wrong diagnostic
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: quality-of-implementation
          Severity: normal
          Priority: P2
         Component: Semantic Analyzer
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: clattner at apple.com
                CC: llvmbugs at cs.uiuc.edu

This invalid code (u is not defined):

void foo() {
  (union u)4;

is rejected with:

t.c:3:3: error: cast to union type from type 'int' not present in union
  (union u)4;
  ^        ~

The diagnostic should say that 'u' is not complete.

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