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

            Bug ID: 18116
           Summary: Consider warning on unintentional uses of the comma
                    operator
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

Created attachment 11647
  --> http://llvm.org/bugs/attachment.cgi?id=11647&action=edit
prototype patch

In v8, some code called

   v8::Debug::SetLiveEditEnabled(false), env->GetIsolate();

when it meant to call

   v8::Debug::SetLiveEditEnabled(false, env->GetIsolate());

(SetLiveEditEnabled() has a default parameter for the 2nd argument)

A possible warning would be to check if the lhs of a comma operator is a call
and the call is still valid when adding the rhs to the call arguments. The
attached patch implements this idea – but it doesn't catch the same thing for
overloads, and it didn't find any other bugs in chromium, so I'm not sure if
it's worth it. I'm attaching the patch if someone else wants to do something
with it.

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