[LLVMbugs] [Bug 10209] New: Num arg handling seems incorrect in ownership attribute

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jun 27 16:52:42 PDT 2011


           Summary: Num arg handling seems incorrect in ownership
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: supertri at google.com
                CC: llvmbugs at cs.uiuc.edu

prompt$ clang -x c -
void bar() __attribute__((ownership_returns(foo, 1, 2)));


<stdin>:1:27: error: attribute requires exactly 3 arguments
void bar() __attribute__((ownership_returns(foo, 1, 2)));
1 error generated.

I gave it 3 arguments...

In the ownership returns case in SemaDeclAttr.cpp, checking for the number of
arguments is very different from the other cases:

    if (AL.getNumArgs() > 1) {
      S.Diag(AL.getLoc(), diag::err_attribute_wrong_number_arguments)
          << AL.getNumArgs() + 1;

Should the number of args for AL be exactly 1? Or 1 or 0? Or 2? Or any number
greater than or equal to 2?

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