================ @@ -0,0 +1,69 @@ +// Refer issue 70464 for more details. +// +// When the base class does not have a declared constructor, the base +// initializer in the constructor of the derived class should use the given +// initializer list to finish the initialization of the base class. +// +// Also testing base constructor and delegate constructor to make sure this +// change will not break these two cases when a CXXConstructExpr is available. + +// RUN: %clang_analyze_cc1 %s -verify -analyzer-checker=core,debug.ExprInspection + +void clang_analyzer_dump(int); + +namespace init_list { + +struct foo { + int foox; +}; + +class bar : public foo { +public: + bar() : foo{42} { + // The dereference to this->foox below should be initialized properly. + clang_analyzer_dump(this->foox); // expected-warning{{42 S32b}} + } +}; + +void entry() { bar test; } + +} // namespace init_list + +namespace base_ctor_call { + +void clang_analyzer_dump(int); ---------------- steakhal wrote:
Only define these in the global namespace, please. That's the common pattern so far in the tests. https://github.com/llvm/llvm-project/pull/70792 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits