...
Code Block | ||||
---|---|---|---|---|
| ||||
#include <iostream> struct Widget { explicit Widget(int I) { std::cout << "Widget constructed" << std::endl; } }; struct Gadget { explicit Gadget(Widget wid) { std::cout << "Gadget constructed" << std::endl; } }; void f() { int i = 3; Gadget g(Widget(i)); std::cout << i << std::endl; } |
...
Tool | Version | Checker | Description | ||||||
| 2510 | ||||||||
Clang |
| -Wvexing-parse |
Related Vulnerabilities
Search for other vulnerabilities resulting from the violation of this rule on the CERT website.
...
[ISO/IEC 14882-2014] | 6.8, "Ambiguity resolution" 8.2, "Ambiguity resolution" |
[Meyers 01] | Item 6, "Be alert for C++'s most vexing parse" |