Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

GCC build error #465

Open
taekahn opened this issue Mar 28, 2022 · 0 comments
Open

GCC build error #465

taekahn opened this issue Mar 28, 2022 · 0 comments

Comments

@taekahn
Copy link
Contributor

taekahn commented Mar 28, 2022

When compiling under GCC 11.2.0 with -std=c++20 the following line causes an error.

StatsObject<N>(uint16_t num_stats, absl::Duration interval, absl::Time now);

The specific error:

external/io_opencensus_cpp/opencensus/common/internal/stats_object.h:81:26: error: expected ')' before 'num_stats'
81 |   StatsObject<N>(uint16_t num_stats, absl::Duration interval, absl::Time now);
|                 ~        ^~~~~~~~~~
|                          )

What i believe is the cause of the error:
StatsObject<N>
I've never seen anyone repeat the template parameter in the declaration of the constructor like this before and believe this to be a syntax error that was previously not being caught by GCC.

-       StatsObject<N>(uint16_t num_stats, absl::Duration interval, absl::Time now);
+       StatsObject(uint16_t num_stats, absl::Duration interval, absl::Time now);

The above change solves the build issue for me.

Created a patch #466

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant