[LLVMbugs] [Bug 7794] New: Poor diagnostic for cast from enum to int&

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Aug 2 19:29:37 PDT 2010


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

           Summary: Poor diagnostic for cast from enum to int&
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: matthewbg at google.com
                CC: llvmbugs at cs.uiuc.edu, nlewycky at google.com


Created an attachment (id=5309)
 --> (http://llvm.org/bugs/attachment.cgi?id=5309)
test case

Test case attached. In particular, the first error should be complaining about
a bad cast, not about anything related to compound literals.

% clang -fsyntax-only ~/clang/testcases/enum_int_bad_diagnostic.cc
/home/matthewbg/clang/testcases/enum_int_bad_diagnostic.cc:6:32: error: 
      expected '{' in compound literal
  for (MyEnum e = a; ; ++(int&)e);
                               ^
/home/matthewbg/clang/testcases/enum_int_bad_diagnostic.cc:6:32: error: 
      expected ')'
/home/matthewbg/clang/testcases/enum_int_bad_diagnostic.cc:6:7: note: to match
      this '('
  for (MyEnum e = a; ; ++(int&)e);
      ^
2 errors 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