Skip to content

extensions: add explicit type annotation for absl::optional#13338

Merged
mattklein123 merged 1 commit intoenvoyproxy:masterfrom
rebello95:explicit-type
Sep 30, 2020
Merged

extensions: add explicit type annotation for absl::optional#13338
mattklein123 merged 1 commit intoenvoyproxy:masterfrom
rebello95:explicit-type

Conversation

@rebello95
Copy link
Contributor

When compiling Envoy Mobile locally, I was seeing the following error without this change:

external/envoy/source/extensions/transport_sockets/tls/ocsp/asn1_utility.cc:37:23: error: no viable constructor or deduction guide for deduction of template arguments of 'optional'
  return is_present ? absl::optional(data) : absl::nullopt;

Risk Level: Low
Testing: N/A
Docs Changes: N/A

Signed-off-by: Michael Rebello me@michaelrebello.com

When compiling Envoy Mobile locally, I was seeing the following error without this change:

```
external/envoy/source/extensions/transport_sockets/tls/ocsp/asn1_utility.cc:37:23: error: no viable constructor or deduction guide for deduction of template arguments of 'optional'
  return is_present ? absl::optional(data) : absl::nullopt;
```

Signed-off-by: Michael Rebello <me@michaelrebello.com>
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Confused how this compiled before but ... C++. Thanks!

@akonradi
Copy link
Contributor

Is Envoy Mobile using C++17? I assume this worked before because of template deduction guides.

@rebello95
Copy link
Contributor Author

Yep it is using C++17. I'm not really clear on why this only seems to break there either

@mattklein123 mattklein123 merged commit 8f16456 into envoyproxy:master Sep 30, 2020
@rebello95 rebello95 deleted the explicit-type branch September 30, 2020 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants