Skip to content
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

Bluesim: Fix templated classes for C++20 #701

Merged
merged 1 commit into from
May 27, 2024

Conversation

quark17
Copy link
Collaborator

@quark17 quark17 commented May 25, 2024

Earlier C++ standards allowed the constructor and destructor of a templated class to be declared with a templated identifier. For example:

template<typename T>
class Foo {
 public:
  Foo<T>();
  ~Foo<T>();
};

This is not accepted by the newer C++ standard, and GCC warns about that:

warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]

This PR resolves it by removing the unnecessary parameters in the constructor and destructor identifiers:

template<typename T>
class Foo {
 public:
  Foo();
  ~Foo();
};

Earlier C++ standards allowed the constructor and destructor of a
templated class to be declared with a template ID.  To support
compiling with newer C++, that consider this an error, we remove
the template parameter.
@quark17 quark17 merged commit a8fe68a into B-Lang-org:main May 27, 2024
48 of 49 checks passed
@quark17 quark17 deleted the update-templated-classes branch May 27, 2024 21:49
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.

1 participant