Core: Add [[nodiscard]] to string-like classes

This commit is contained in:
Thaddeus Crews
2024-06-23 12:28:04 -05:00
parent 6a6a1168a5
commit 579feb387c
12 changed files with 22 additions and 21 deletions

View File

@ -1563,7 +1563,8 @@ Error ShaderCompiler::compile(RS::ShaderMode p_mode, const String &p_code, Ident
shader = parser.get_shader();
function = nullptr;
_dump_node_code(shader, 1, r_gen_code, *p_actions, actions, false);
// Return value only relevant within nested calls.
_ALLOW_DISCARD_ _dump_node_code(shader, 1, r_gen_code, *p_actions, actions, false);
return OK;
}

View File

@ -552,7 +552,8 @@ void ShaderPreprocessor::process_else(Tokenizer *p_tokenizer) {
if (skip) {
Vector<String> ends;
ends.push_back("endif");
next_directive(p_tokenizer, ends);
// Legacy return value.
_ALLOW_DISCARD_ next_directive(p_tokenizer, ends);
}
}
@ -847,7 +848,8 @@ void ShaderPreprocessor::start_branch_condition(Tokenizer *p_tokenizer, bool p_s
ends.push_back("elif");
ends.push_back("else");
ends.push_back("endif");
next_directive(p_tokenizer, ends);
// Legacy return value.
_ALLOW_DISCARD_ next_directive(p_tokenizer, ends);
}
}