Index: lib/Analysis/CFG.cpp =================================================================== --- lib/Analysis/CFG.cpp +++ lib/Analysis/CFG.cpp @@ -1298,7 +1298,6 @@ // Support pre-C++17 copy elision AST. auto *CE = cast(Child); if (BuildOpts.MarkElidedCXXConstructors && CE->isElidable()) { - assert(CE->getNumArgs() == 1); findConstructionContexts(withExtraLayer(CE), CE->getArg(0)); } Index: test/Analysis/cfg-rich-constructors.cpp =================================================================== --- test/Analysis/cfg-rich-constructors.cpp +++ test/Analysis/cfg-rich-constructors.cpp @@ -937,3 +937,15 @@ E e = E(D()); } } // end namespace argument_constructors + +namespace copy_elision_with_extra_arguments { +class C { +public: + C(); + C(const C &c, int x = 0); +}; + +void testCopyElisionWhenCopyConstructorHasExtraArguments() { + C c = C(); +} +} // namespace copy_elision_with_extra_arguments