-
Notifications
You must be signed in to change notification settings - Fork 5.1k
c++20 by default #32585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
c++20 by default #32585
Changes from all commits
f5e7024
4e052d2
c5c4558
9be7455
f22aed8
badd720
f3efb0c
a8a119f
875f5ba
f8df3bb
6075777
2d0399a
df07980
fbc2054
947e3a4
d07557e
6d21545
433e6a2
1c66e35
b536ffe
fe4d13a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
diff --git a/proxy_wasm_api.h b/proxy_wasm_api.h | ||
index 166b49c..b44637c 100644 | ||
--- a/proxy_wasm_api.h | ||
+++ b/proxy_wasm_api.h | ||
@@ -1207,8 +1207,9 @@ struct SimpleHistogram { | ||
template <typename... Tags> struct Counter : public MetricBase { | ||
static Counter<Tags...> *New(std::string_view name, MetricTagDescriptor<Tags>... fieldnames); | ||
|
||
- Counter<Tags...>(std::string_view name, MetricTagDescriptor<Tags>... descriptors) | ||
- : Counter<Tags...>(std::string(name), std::vector<MetricTag>({toMetricTag(descriptors)...})) { | ||
+ template <typename... T> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is proxy_wasm_api incompatible with C++20? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, this is just some helper AFAICT which is only used in one place in a test. |
||
+ Counter(std::string_view name, MetricTagDescriptor<T>... descriptors) | ||
+ : Counter<T...>(std::string(name), std::vector<MetricTag>({toMetricTag(descriptors)...})) { | ||
} | ||
|
||
SimpleCounter resolve(Tags... f) { | ||
@@ -1256,8 +1257,9 @@ inline Counter<Tags...> *Counter<Tags...>::New(std::string_view name, | ||
template <typename... Tags> struct Gauge : public MetricBase { | ||
static Gauge<Tags...> *New(std::string_view name, MetricTagDescriptor<Tags>... fieldnames); | ||
|
||
- Gauge<Tags...>(std::string_view name, MetricTagDescriptor<Tags>... descriptors) | ||
- : Gauge<Tags...>(std::string(name), std::vector<MetricTag>({toMetricTag(descriptors)...})) {} | ||
+ template <typename... T> | ||
+ Gauge(std::string_view name, MetricTagDescriptor<T>... descriptors) | ||
+ : Gauge<T...>(std::string(name), std::vector<MetricTag>({toMetricTag(descriptors)...})) {} | ||
|
||
SimpleGauge resolve(Tags... f) { | ||
std::vector<std::string> fields{toString(f)...}; | ||
@@ -1302,8 +1304,9 @@ inline Gauge<Tags...> *Gauge<Tags...>::New(std::string_view name, | ||
template <typename... Tags> struct Histogram : public MetricBase { | ||
static Histogram<Tags...> *New(std::string_view name, MetricTagDescriptor<Tags>... fieldnames); | ||
|
||
- Histogram<Tags...>(std::string_view name, MetricTagDescriptor<Tags>... descriptors) | ||
- : Histogram<Tags...>(std::string(name), | ||
+ template <typename... T> | ||
+ Histogram(std::string_view name, MetricTagDescriptor<T>... descriptors) | ||
+ : Histogram<T...>(std::string(name), | ||
std::vector<MetricTag>({toMetricTag(descriptors)...})) {} | ||
|
||
SimpleHistogram resolve(Tags... f) { |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -271,7 +271,14 @@ void Utility::extractCommonAccessLogProperties( | |
} | ||
|
||
if (stream_info.upstreamInfo().has_value()) { | ||
#if defined(__GNUC__) && !defined(__clang__) | ||
#pragma GCC diagnostic push | ||
#pragma GCC diagnostic ignored "-Wdangling-reference" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like we have quite a few of these. Is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, gcc implementation is buggy, you can find reports in other projects. The pattern here is unusual but the same, so maybe better keep it since we know when the false positive happens. |
||
#endif | ||
const auto& upstream_info = stream_info.upstreamInfo().value().get(); | ||
#if defined(__GNUC__) && !defined(__clang__) | ||
#pragma GCC diagnostic pop | ||
#endif | ||
if (upstream_info.upstreamHost() != nullptr) { | ||
Network::Utility::addressToProtobufAddress( | ||
*upstream_info.upstreamHost()->address(), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove the "//"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I plan to update cel-cpp immediately and get rid of this patch or fix it upstream. I can't tell if this is a real issue or not with GCC.