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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to