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

             Bug #: 11863
           Summary: attribute((nonnull)) not checked on c++ operators
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


Testcase:

  struct foo {};
  bool operator!=(const foo &, void *) __attribute__((nonnull(2)));
  bool test(const foo &f) {
    return f != 0;
  }

nlewycky@ducttape:~$ g++ str2.cc -fsyntax-only -Wall
str2.cc: In function ‘bool test(const foo&)’:
str2.cc:6: warning: null argument where non-null required (argument 2)

vs.

nlewycky@ducttape:~$ clang++ str2.cc -fsyntax-only -Wall
nlewycky@ducttape:~$

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