[LLVMbugs] [Bug 14057] New: Incorrect "cannot pass object of non-POD type '...'through variadic method" error when overloading operator()

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Oct 10 14:25:20 PDT 2012


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

             Bug #: 14057
           Summary: Incorrect "cannot pass object of non-POD type
                    '...'through variadic method" error when overloading
                    operator()
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: abbeyj at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


I'm getting an error:
error: cannot pass object of non-POD type 'F' through variadic method; call
will abort at runtime [-Wnon-pod-varargs]

I think this is being triggered incorrectly.  That's only supposed to be an
error when the type is being passed in the variadic arguments, not in the fixed
ones, right?  Something about the operator() overloading seems to be producing
the inconsistent results.  The test case below works in clang-3.1 and in g++
but fails in trunk.

$ cat test.cxx
struct F {
  F();
};

struct S {
  void operator()(F, ...);
};

void foo() {
  S s;
  F f;
  s.operator()(f);  // works fine
  s(f);             // error
}

$ clang++ -fsyntax-only test.cxx
test.cxx:13:5: error: cannot pass object of non-POD type 'F' through variadic
method; call will abort at runtime [-Wnon-pod-varargs]
  s(f);             // error
    ^
1 error generated.

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