[LLVMbugs] [Bug 10112] New: extra error message for problems in statement expressions

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jun 9 09:38:21 PDT 2011


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

           Summary: extra error message for problems in statement
                    expressions
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: bob.wilson at apple.com
                CC: llvmbugs at cs.uiuc.edu


Clang is not propagating expression errors for statement expressions so that it
thinks that the expression type is void, which in turn causes an extra error
message to be printed.

Testcase:

$ cat experr.c 
float test(int v) {
  return ({ int __a = (v); (float)__a/; });
}


$ clang -S experr.c 
experr.c:2:39: error: expected expression
  return ({ int __a = (v); (float)__a/; });
                                      ^
experr.c:2:10: error: returning 'void' from a function with incompatible result
      type 'float'
  return ({ int __a = (v); (float)__a/; });
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.

That second message ("returning 'void'....") should be suppressed.

-- 
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