Annotate unreachable comment-scanner switch paths to satisfy C26819 (#5071)
diff --git a/include/nlohmann/detail/input/lexer.hpp b/include/nlohmann/detail/input/lexer.hpp index 3d63229..4742d88 100644 --- a/include/nlohmann/detail/input/lexer.hpp +++ b/include/nlohmann/detail/input/lexer.hpp
@@ -863,6 +863,8 @@ break; } } + + JSON_HEDLEY_UNREACHABLE(); } // multi-line comments skip input until */ is read @@ -898,6 +900,8 @@ continue; } } + + JSON_HEDLEY_UNREACHABLE(); } // unexpected character after reading '/'
diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 7d68c5a..e2bb851 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp
@@ -8055,6 +8055,8 @@ break; } } + + JSON_HEDLEY_UNREACHABLE(); } // multi-line comments skip input until */ is read @@ -8090,6 +8092,8 @@ continue; } } + + JSON_HEDLEY_UNREACHABLE(); } // unexpected character after reading '/'