[LLVMbugs] [Bug 15850] New: container ::empty should be __attribute__((warn_unused_result))

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 26 05:16:30 PDT 2013


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

            Bug ID: 15850
           Summary: container ::empty should be
                    __attribute__((warn_unused_result))
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: richard-llvm at metafoo.co.uk
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Here's a common beginner mistake with standard library containers:

  std::vector<int> vi;
  // ...

  // empty the vector
  vi.empty();

We should warn on this -- adding __attribute__((warn_unused_result)) to empty
should do the trick.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130426/921bbe1b/attachment.html>


More information about the llvm-bugs mailing list