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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to