https://bugs.llvm.org/show_bug.cgi?id=46642
Bug ID: 46642
Summary: -Wuninitialized diagnostic missing for operator->
usage
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected],
[email protected]
Consider the example:
struct A {
A();
A& foo();
A* operator->();
};
struct B {
B(A&);
};
struct composed2 {
B b_;
A a_;
composed2() : b_(a_->foo()), a_() {} // does not warn!
//composed2(int) : b_(a_.foo()), a_() {} // warns
};
We are calling an operator-> on a uninitialized variable `a_`, but the
diagnostic is missing.
Godbolt playground: https://godbolt.org/z/Ty8bgA
--
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