File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -664,6 +664,15 @@ Improvements to Clang's diagnostics
664664 bool operator==(const C&) = default;
665665 };
666666
667+ - Clang now emits `-Wdangling-capture ` diangostic when a STL container captures a dangling reference.
668+
669+ .. code-block :: c++
670+
671+ void test() {
672+ std::vector<std::string_view> views;
673+ views.push_back(std::string("123")); // warning
674+ }
675+
667676Improvements to Clang's time-trace
668677----------------------------------
669678
Original file line number Diff line number Diff line change @@ -10237,10 +10237,10 @@ def warn_dangling_pointer_assignment : Warning<
1023710237 InGroup<DanglingAssignment>;
1023810238def warn_dangling_reference_captured : Warning<
1023910239 "object whose reference is captured by '%0' will be destroyed at the end of "
10240- "the full-expression">, InGroup<DanglingCapture>, DefaultIgnore ;
10240+ "the full-expression">, InGroup<DanglingCapture>;
1024110241def warn_dangling_reference_captured_by_unknown : Warning<
1024210242 "object whose reference is captured will be destroyed at the end of "
10243- "the full-expression">, InGroup<DanglingCapture>, DefaultIgnore ;
10243+ "the full-expression">, InGroup<DanglingCapture>;
1024410244
1024510245// For non-floating point, expressions of the form x == x or x != x
1024610246// should result in a warning, since these always evaluate to a constant.
You can’t perform that action at this time.
0 commit comments