The code is as follow: struct Foo { Foo() {} Foo(const Foo&) {} }; void f(...); void g() { Foo foo; f(foo); void (*fp)(...) = f; fp(foo); } g++ accepts it, but clang++ rejects it: code1.cpp:10:4: error: cannot pass object of non-trivial type 'Foo' through variadic function; call will abort at runtime [-Wnon-pod-varargs] f(foo); ^ code1.cpp:12:5: error: cannot pass object of non-trivial type 'Foo' through variadic function; call will abort at runtime [-Wnon-pod-varargs] fp(foo); ^ 2 errors generated.
Not a bug. The standard says passing non-trivial types through varargs is "conditionally-supported" so an implementation can either support it, or reject it with a diagnostic. GCC supports it, Clang doesn't.
I think this is actually a dup of bug 64867 *** This bug has been marked as a duplicate of bug 64867 ***
I disagree. This report states "g++ accepts it, but clang++ rejects it" and that is not a bug, it's a feature. If a diagnostic is desired it can be requested with -Wconditionally-supported or -Werror-conditionally-supported 64867 says "It would be nice to have a distinct warning flag for this feature" which is different. This bug is invalid.