[all-commits] [llvm/llvm-project] 4b4650: [JSON] Fix uninitialized variable warning

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Fri Apr 7 14:02:55 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4b4650948af347c73fcf812645c2afd1955bc083
      https://github.com/llvm/llvm-project/commit/4b4650948af347c73fcf812645c2afd1955bc083
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2023-04-07 (Fri, 07 Apr 2023)

  Changed paths:
    M llvm/include/llvm/Support/JSON.h

  Log Message:
  -----------
  [JSON] Fix uninitialized variable warning

Fix uninitialized variable warning when deserializing a std::optional<E>
where is an enum type.

JSON.h:771:20: warning: variable 'Result' is uninitialized when used here [-Wuninitialized]
  if (!fromJSON(E, Result, P))
                   ^~~~~~




More information about the All-commits mailing list