mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 21:30:12 +01:00
Switch to trailing returns in toolchain and related code. (#4919)
Also makes the style guide explicitly comment on void, but this was the intent IIRC because it matches Carbon's `-> ()` (and "always" versus "except for void", which we definitely went back and forth on). Includes adjusting function pointers, which I definitely forget this syntax works sometimes. Excludes utils/tree_sitter/src/scanner.c because it claims to be C, but really we should probably fix that to be cpp.
This commit is contained in:
+4
-3
@@ -21,7 +21,7 @@ using RawHashtable::TestData;
|
||||
using ::testing::UnorderedElementsAreArray;
|
||||
|
||||
template <typename SetT, typename MatcherRangeT>
|
||||
void ExpectSetElementsAre(SetT&& s, MatcherRangeT element_matchers) {
|
||||
auto ExpectSetElementsAre(SetT&& s, MatcherRangeT element_matchers) -> void {
|
||||
// Collect the elements into a container.
|
||||
using KeyT = typename std::remove_reference<SetT>::type::KeyT;
|
||||
std::vector<KeyT> entries;
|
||||
@@ -34,8 +34,9 @@ void ExpectSetElementsAre(SetT&& s, MatcherRangeT element_matchers) {
|
||||
|
||||
// Allow directly using an initializer list.
|
||||
template <typename SetT, typename MatcherT>
|
||||
void ExpectSetElementsAre(SetT&& s,
|
||||
std::initializer_list<MatcherT> element_matchers) {
|
||||
auto ExpectSetElementsAre(SetT&& s,
|
||||
std::initializer_list<MatcherT> element_matchers)
|
||||
-> void {
|
||||
std::vector<MatcherT> element_matchers_storage = element_matchers;
|
||||
ExpectSetElementsAre(s, element_matchers_storage);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user