https://bugs.llvm.org/show_bug.cgi?id=42959
Bug ID: 42959
Summary: Passing non-trivial type through variadic lambda does
not trigger -Wnon-pod-varargs
Product: clang
Version: 8.0
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected],
[email protected]
Tested with Clang 8.0.0 and 8.0.1 on Linux x86-64 (Devuan and CentOS) and the
version that ships with Xcode 10.3 on macOS (Mojave).
Compiled with "-stdlib=libc++ -std=c++17 -O2".
#include <functional>
#include <string>
int main() {
using Callback = std::function<void (const std::string&)>;
auto foo = [] (Callback fn, const std::string& arg) { fn(arg); };
foo([] (...) {}, "");
return 0;
}
This generate an invalid opcode (ud2) without any warnings or errors.
I'm not sure what I would expected to happen here. I would not expect the
silent generation of an invalid opcode though. The closest thing I could think
of was that this should trigger the -Wnon-pod-varargs error.
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs