diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-04-05 14:06:16 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2019-04-05 15:14:53 +0200 |
commit | fc370b3feb419fdc1a8139bdf01f1dacf868ca1f (patch) | |
tree | 9d7409482045aeaee31994ed6ae5b00f7fd1a4db /main | |
parent | e4a96164b6e52dac6aff7ddad05bd3ed735840a9 (diff) |
Fix -Wimplicit-fallthrough warnings from GCC 8
Adds `FALLTHROUGH` macro to specify when a fallthrough is intentional.
Can be replaced by `[[fallthrough]]` if/when we switch to C++17.
The warning is now enabled by default for GCC on `extra` warnings level
(part of GCC's `-Wextra`). It's not enabled in Clang's `-Wextra` yet,
but we could enable it manually once we switch to C++11. There's no
equivalent feature in MSVC for now.
Fixes #26135.
Diffstat (limited to 'main')
-rw-r--r-- | main/tests/test_gdscript.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/main/tests/test_gdscript.cpp b/main/tests/test_gdscript.cpp index 27180f84aa..7a711e8cc9 100644 --- a/main/tests/test_gdscript.cpp +++ b/main/tests/test_gdscript.cpp @@ -127,6 +127,7 @@ static String _parser_expr(const GDScriptParser::Node *p_expr) { case GDScriptParser::OperatorNode::OP_PARENT_CALL: txt += "."; + FALLTHROUGH; case GDScriptParser::OperatorNode::OP_CALL: { ERR_FAIL_COND_V(c_node->arguments.size() < 1, ""); |