Skip to content

Fix ambiguous auto variable on gcc 7.5#1976

Closed
smnogar wants to merge 1 commit intoros2:rollingfrom
smnogar:gcc7.5-fix
Closed

Fix ambiguous auto variable on gcc 7.5#1976
smnogar wants to merge 1 commit intoros2:rollingfrom
smnogar:gcc7.5-fix

Conversation

@smnogar
Copy link
Copy Markdown

@smnogar smnogar commented Jul 22, 2022

I'm running humble on an older version of embedded linux thats stuck with gcc 7.5. For some reason it didn't like this auto declaration. Could we get this pushed into rolling and humble branches?

This should resolve #1963

Signed-off-by: Steve Nogar <stephen.m.nogar.civ@army.mil>
@clalancette
Copy link
Copy Markdown
Contributor

@smnogar The linters are unhappy with the length of the line. If you fix that, we can run CI on this and get it in.

Copy link
Copy Markdown
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clalancette clalancette added the more-information-needed Further information is required label Aug 18, 2022
return std::nullopt;
}
auto value = std::move(it->second.second);
std::optional<CallbackInfoVariant> value = std::optional<CallbackInfoVariant>{std::move(it->second.second)};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that if the type is explicit on the right then auto can be used on the left i.e.

Suggested change
std::optional<CallbackInfoVariant> value = std::optional<CallbackInfoVariant>{std::move(it->second.second)};
auto value = std::optional<CallbackInfoVariant>{std::move(it->second.second)};

@fujitatomoya
Copy link
Copy Markdown
Collaborator

@smnogar would you address comments above? thanks!

@clalancette
Copy link
Copy Markdown
Contributor

Since there has been no movement on this in a long time, I'm going to close this out. Feel free to respond to the comments and reopen if you are still interested in getting this in, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

more-information-needed Further information is required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error During Colcon Build

4 participants