Issue 81116
Summary clang/lib/Analysis/AnalysisDeclContext.cpp:702: possible undefined behaviour ?
Labels clang
Assignees
Reporter dcb314
    Static analyser cppcheck says:

clang/lib/Analysis/AnalysisDeclContext.cpp:702:12: error: Deallocation of an auto-variable (*) results in undefined behaviour. [autovarInvalidDeallocation]

Source code is

 for (llvm::FoldingSet<LocationContext>::iterator I = Contexts.begin(),
 E = Contexts.end(); I != E; ) {
    LocationContext *LC = &*I;
 ++I;
    delete LC;
  }

Is this maybe a clumsy attempt at erase ?

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to