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: unassignedclangb...@nondot.org
          Reporter: antosh...@gmail.com
                CC: blitzrak...@gmail.com, dgre...@apple.com,
                    erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
                    richard-l...@metafoo.co.uk

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
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to