================
@@ -1532,10 +1532,11 @@ const Stmt *LabelStmt::getInnermostLabeledStmt() const {
   return S;
 }
 
-const Stmt *LoopControlStmt::getNamedLoopOrSwitch() const {
-  if (!hasLabelTarget())
-    return nullptr;
-  return getLabelDecl()->getStmt()->getInnermostLabeledStmt();
+const std::optional<Stmt *> LoopControlStmt::getNamedLoopOrSwitch() const {
----------------
tbaederr wrote:

The problem with `std::optional<ptr>` is that you now have _two_ invalid 
states. We had problems in the past where we returned a non-std::nullopt 
optional that still wrapped a null pointer.

https://github.com/llvm/llvm-project/pull/228655
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to