dongjianqiang2 wrote: > ``` > enum class test > { > err1, > err2, > ok > }; > > int check_err (test v) > { > switch (v) > { > case test::err1: > return 1; > case test::err2: > return 2; > case test::ok: > break; > } > return 0; > } > ``` > > report: main.cxx:40:3: error: 'switch' missing 'default' label > [-Werror,-Wswitch-default] > > how to solve for enum class? try to build libfmt project with > fmt/include/fmt/format.h:3878:3: error: 'switch' missing 'default' label > [-Werror,-Wswitch-default] and other errors
Hi, -Wswitch-default is a warning option on switch which don't have the default branch, the option is disabled by default, You can check whether -Wswitch-default is added in the build script. https://github.com/llvm/llvm-project/pull/73077 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits