https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102573
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to wjf from comment #2) > I know that adding "-fsanitize=address" could detect the > stack-use-after-scope in runtime. But why not just delete the copy member in > std::initializer_list implementation? I don't see much sense to permit the > copy operation. Because the standard requires it. https://cplusplus.github.io/LWG/issue2432 Until the standard is changed, libstdc++ will define the assignment operator.