public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-8805] libitm: small update for C++20
@ 2024-02-05 15:32 Marek Polacek
0 siblings, 0 replies; only message in thread
From: Marek Polacek @ 2024-02-05 15:32 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:8ca585e56c1d6837f96ddd88c13ed1e815c74f93
commit r14-8805-g8ca585e56c1d6837f96ddd88c13ed1e815c74f93
Author: Marek Polacek <polacek@redhat.com>
Date: Sat Feb 3 09:47:17 2024 -0500
libitm: small update for C++20
C++20 DR 2237 disallows simple-template-id in cdtors, so you
can't write
template<typename T>
struct S {
S<T>(); // should be S();
};
This hasn't been a problem until now but I'm adding a warning about it
to -Wc++20-compat which libitm apparently uses.
libitm/ChangeLog:
* containers.h (vector): Remove the template-id in constructors.
Diff:
---
libitm/containers.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libitm/containers.h b/libitm/containers.h
index 2842fa038eda..4160b16d5696 100644
--- a/libitm/containers.h
+++ b/libitm/containers.h
@@ -48,7 +48,7 @@ class vector
static const size_t default_resize_min = 32;
// Don't try to copy this vector.
- vector<T, alloc_separate_cl>(const vector<T, alloc_separate_cl>& x);
+ vector(const vector<T, alloc_separate_cl>& x);
public:
typedef T datatype;
@@ -59,7 +59,7 @@ class vector
T& operator[] (size_t pos) { return entries[pos]; }
const T& operator[] (size_t pos) const { return entries[pos]; }
- vector<T, alloc_separate_cl>(size_t initial_size = default_initial_capacity)
+ vector(size_t initial_size = default_initial_capacity)
: m_capacity(initial_size),
m_size(0)
{
@@ -68,7 +68,7 @@ class vector
else
entries = 0;
}
- ~vector<T, alloc_separate_cl>() { if (m_capacity) free(entries); }
+ ~vector() { if (m_capacity) free(entries); }
void resize(size_t additional_capacity)
{
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-02-05 15:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-05 15:32 [gcc r14-8805] libitm: small update for C++20 Marek Polacek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).