[all-commits] [llvm/llvm-project] cda093: Update coding standards for constexpr if statement...
Aaron Ballman via All-commits
all-commits at lists.llvm.org
Fri Aug 19 12:53:39 PDT 2022
Author: Aaron Ballman <aaron at aaronballman.com>
Date: 2022-08-19 (Fri, 19 Aug 2022)
Update coding standards for constexpr if statements; NFC
We currently suggest that users not use an else clause after a return
statement in a prior if branch. e.g.,
else // Should remove this else clause
however, this suggestion is incorrect for a constexpr if statement
because one of the two branches will be a discarded statement and thus
can impact template instantiation behavior. This updates the coding
standard to make it clear that it's okay to have a return after an else
in a constexpr if statement.
I think this is an NFC change to the intent of the rule, which is why
I've not started an RFC for the changes.
Differential Revision: https://reviews.llvm.org/D132232
More information about the All-commits