https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113149
--- Comment #1 from Ed Catmur ---
>From b4ca8bf55100eddeaa14a52f1bc8e73fac565d83 Mon Sep 17 00:00:00 2001
From: Ed Catmur
Date: Tue, 26 Dec 2023 11:46:26 -0600
Subject: [PATCH] Swap P_PROC_AVX2 with P_X86_64_V3, etc.
https://gcc.gnu.org/bugzil
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
Since #101696, we can write
__attribute__ ((target ("arch=x86-64-v3")))
char const* f() { return "x86-64-v3";
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
Since 4.9.0,
template
struct B {
B();
B(B con
: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
#include
struct A { int j; };
struct B {
bool await_ready();
bool await_suspend(std
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111944
--- Comment #1 from Ed Catmur ---
Correction, it does affect sanitizers (-O2 -fsanitize=address) as well as -Og.
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
Since 12.1, with Boost 1.71 or later,
#include
int main() {
boost::variant2::variant r;
r.emplace();
}
In membe
mponent: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
Since 6.1, gcc accepts the following (without warnings at any level):
int f() = delete("should have a reason");
Much as I'd love to be able to write this, gcc seems to be
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111602
--- Comment #2 from Ed Catmur ---
(In reply to Andrew Pinski from comment #1)
> The local type of f() is not needed.
Thanks! I was confused since the local type is required in this similar
example:
template struct P
{
static constexpr bool
oduct: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
Since gcc 8.1,
template constexpr bool V = true
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111094
Ed Catmur changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24639
Bug 24639 depends on bug 111094, which changed state.
Bug 111094 Summary: Spurious Wuninitialized swapping underlying bytes of object
representation in move constructor
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111094
What|Remo
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
struct S { short x, y; };
struct A {
A() {}
A(A&& rhs) {
auto p = reinterpret
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111090
Ed Catmur changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24639
Bug 24639 depends on bug 111090, which changed state.
Bug 111090 Summary: Bogus -Wuninitialized for trivial copy of nested struct
with partially initialized array
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111090
What|Removed
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111090
--- Comment #1 from Ed Catmur ---
uh, -O -Wall is necessary, obviously. https://godbolt.org/z/eT9dY467P
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
struct A {
A() { buf[0] = 0; }
int buf[2];
};
struct B { A a; };
struct C {
C(B const& b) : b(b) {}
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
#include
struct S { int i; };
static_assert(requires(S s) { requires std::destructible; });
In file included from :1:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425
--- Comment #58 from Ed Catmur ---
(In reply to Roman Krotov from comment #57)
> But I don't see any reasons not to implement the switch right now...
Making [[gnu::warn_unused_result]] mean the same as [[nodiscard]] would be a
reduction in expres
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425
--- Comment #55 from Ed Catmur ---
(In reply to Roman Krotov from comment #54)
[[nodiscard]] is in C23, so we can expect that attribute to be adopted where
people intend that behavior (warning suppressible by cast to void) as opposed
to the nonpo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110835
--- Comment #6 from Ed Catmur ---
Thanks, filed https://github.com/llvm/llvm-project/issues/64190 .
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110835
--- Comment #1 from Ed Catmur ---
Motivation is
https://github.com/boostorg/exception/blob/b039b4ea18ef752d0c1684b3f715ce493b778060/include/boost/exception/detail/exception_ptr.hpp#L550
; the half-reduced code is:
#include
struct S {};
int mai
: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
#include
std::exception_ptr p;
void f() {
try { throw 1; } catch(char) { std::rethrow_exception(p); }
}
int main() {
for (int i
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110809
--- Comment #5 from Ed Catmur ---
The original code is valid. A reduced valid case would be:
```
template struct S {};
template struct bucket {};
template
int find_indices_impl(bucket const &);
struct HashTable : bucket, 1>, bucket, 2> {};
au
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
#include
using A = double;
template struct S {};
auto x = boost::hana::make_map(
boost::hana::make_pair(boost::hana::type_c>, 1),
bo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110493
--- Comment #4 from Ed Catmur ---
Ah, thanks. So a workaround is something like:
void f() { static auto a = {((bool*)&(int const&)0, std::string())}; }
That's not too bad, then.
on: 12.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
Since 12.3.0, under -fsanitize=undefined -std=c++20:
#include
: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
#define _GLIBCXX_DEBUG
#include
#include
constexpr bool f(std::string const& l, std::string const& r) {
return st
verity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
struct X { int a[1]; };
constexpr bool b = (X{}.a != 0);
:7:27: error: '(((int*)(&.X::a)) != 0)' is not a constant
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109958
--- Comment #3 from Ed Catmur ---
B::f is a static member function so yes, it's valid. A class member access
expression naming a static member function is an lvalue designating that
function, and it shouldn't make any difference that the functio
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
struct B { static int f(); };
struct D : B
iority: P3
Component: preprocessor
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
#pragma GCC diagnostic warning "-Wall"
#pragma GCC diagnostic ignored "-Wall"
int i = 0 | 1 & 2;
warning: suggest parenthes
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
Since 12.3.0, when compiled under tsan (-fsanitize=thread), #include
transitively includes sanitizer
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
template struct X {};
template
struct M {
using R = decltype([] { return 1; }());
template struct S { X p; };
};
M
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83780
--- Comment #4 from Ed Catmur ---
Clang has fixed this in
https://github.com/llvm/llvm-project/commit/4ddf140c00408ecee9d20f4470e69e0f696d8f8a
(12.0.0-rc1).
: 13.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
gcc accepts-invalid:
struct B { private: B(); };
template int f(T
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109640
--- Comment #2 from Ed Catmur ---
Ah, so this is Bug 108165? That's a shame, we use (temporary) lambdas
extensively so I think we'd have to disable the warning entirely.
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
bool b() {
int a;
int&& i = [](int& r) -> int&& { return static_cast(r); }(a);
a
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
template concept C = true;
template struct A {
int f() requires
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79682
Ed Catmur changed:
What|Removed |Added
CC||ed at catmur dot uk
--- Comment #2 from Ed
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70536
--- Comment #6 from Ed Catmur ---
Resubmitted:
https://gcc.gnu.org/pipermail/gcc-patches/2023-February/611366.html
Hopefully this time I'll remember to save the email for pinging.
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
Since 11.1, the following ices in -std=c++20 and later:
template struct C { template static constexpr int x = 1; };
template template int C
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70536
--- Comment #5 from Ed Catmur ---
PR: https://github.com/ecatmur/gcc/pull/5
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
template long f(int(*)[t], T(*)[t]);
template int f(int(*)[i], T(*)[i]);
int n = f(0, 0);
:4:18: internal compiler error
++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
Since 12, at -std=c++17 -O -Wuninitialized:
#include
struct X {
X() = default;
X(X const& r) : i(r.i) {}
int i;
};
struct Y {
Y() : x() {}
X x;
std::option
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106712
--- Comment #1 from Ed Catmur ---
I believe this is happening because start_decl can modify prefix_attributes (by
first chaining it onto attributes, then passing the merged chain to
grokdeclarator which can then chain onto that merged chain).
: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
In [[first-attribute]] int f [[second-attribute]](), g();
the [[first-attribute]] should apply to both f and g, the [[second
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
Reduced testcase:
#include
void g(auto f1) {
auto f2 = std::move(f1);
}
struct F;
struct E {
F* f = nullptr;
};
struct F {
E* e
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106074
--- Comment #1 from Ed Catmur ---
Another example, using Date 3.0.1:
#include
void f(std::istream s) {
std::chrono::system_clock::time_point tp;
date::from_stream(s, "%Y", tp);
}
https://godbolt.org/z/fscqTd947
In file included from
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
Since 12.1.0:
At -O3 -std=c++20 -Werror=stringop-overflow:
#include
void f() {
std::vector v;
v.resize(26);
v.resize(33);
v.resize(39);
v.resize(47
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103993
--- Comment #4 from Ed Catmur ---
And another example, provoked by throwing new (this only happens at -Og):
#include
struct D {
D();
static void* operator new (std::size_t s) {
if (void* p = ::malloc(s))
return p;
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
Code adapted from
https://github.com/capnproto/capnproto/blob/be7a80b4add706ddaeb41689221146b86c3e0f5f/c%2B%2B/src/kj/string.c%2B%2B#L157-L203
:
auto f
++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
#include
template
std::to_chars_result toChars(char (& buf)[N], int number) {
char temp[N];
std::to_chars_result result = std::to_chars(temp, temp + N, number);
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105585
--- Comment #2 from Ed Catmur ---
Affected code: https://github.com/abseil/abseil-cpp/issues/1175
The proposed patch to abseil-cpp corresponds to adding an assumption that `b`
is true above.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105585
--- Comment #1 from Ed Catmur ---
Flags: -O1 -Wstringop-overflow=1
https://godbolt.org/z/8r8roz7Pa
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
Reduced (from code in abseil-cpp):
#include
struct S {
int i;
std::atomic a;
};
S* q();
void f();
void g(bool b) {
auto p = b ? q
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105545
Ed Catmur changed:
What|Removed |Added
CC||ed at catmur dot uk
--- Comment #3 from Ed
: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
Simplified:
template struct when;
template constexpr int B = 1;
template struct A;
template struct A> {}; // fallback
template struct A == 1>> {};
A> a;
&q
++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
[bit.cast] Constraints (nb. prior to P1719R2 these were specified as SFINAE,
but they have been there since the start):
(1.1) sizeof(To) == sizeof(From) is true;
(1.2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104996
--- Comment #5 from Ed Catmur ---
Posted https://gcc.gnu.org/pipermail/gcc-patches/2022-March/592154.html
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104996
--- Comment #4 from Ed Catmur ---
(In reply to Patrick Palka from comment #2)
> We started rejecting the commented out static_assert after
> r10-3740-g89e0a492af5bec.
Thanks, that accords with my analysis - the branch in call.cc:compare_ics tha
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104996
--- Comment #1 from Ed Catmur ---
This should fix it:
https://github.com/gcc-mirror/gcc/compare/master...ecatmur:pr-104996
Please test and report back.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69623
--- Comment #8 from Ed Catmur ---
(In reply to jim x from comment #7)
>
> auto f(auto..., auto a, auto...) { return a; }
>
> IIUC, this is just disallowed since all arguments would only match the first
> function parameter pack.
Maybe?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69623
Ed Catmur changed:
What|Removed |Added
CC||ed at catmur dot uk
--- Comment #6 from Ed
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70536
--- Comment #4 from Ed Catmur ---
Posted: https://gcc.gnu.org/pipermail/gcc-patches/2022-March/591678.html
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77465
--- Comment #4 from Ed Catmur ---
Branch: https://github.com/gcc-mirror/gcc/compare/master...ecatmur:so-66816741
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70536
--- Comment #3 from Ed Catmur ---
Updated: https://github.com/gcc-mirror/gcc/compare/master...ecatmur:pr-70536
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77465
--- Comment #3 from Ed Catmur ---
Sent patches to mailing list:
https://gcc.gnu.org/pipermail/gcc-patches/2021-December/587495.html
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92944
--- Comment #2 from Ed Catmur ---
Sorry, meant to link this:
https://quuxplusone.github.io/blog/2021/10/27/dont-reopen-namespace-std/
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92944
--- Comment #1 from Ed Catmur ---
This becomes problematic when N::Q is std::hash; we are encouraged not to
reopen namespace std but to specialize std::hash from the root namespace.
Example:
#include
template constexpr bool P = false;
template
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102047
--- Comment #1 from Ed Catmur ---
cf. https://bugs.llvm.org/show_bug.cgi?id=51604
: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
template concept A = true;
template concept M = requires {
L.template operator()();
};
template concept C = requires(T t
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
template struct A { A(T); };
auto p = new A[]{1};
g++
(Compiler-Explorer-Build-gcc-f0fca213bc52644ba896da622b35842a6157bd98-binutils-2.36.1
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100878
--- Comment #1 from Ed Catmur ---
Per godbolt, this appears to be fixed on trunk: https://godbolt.org/z/xxz8ecxzK
g++
(Compiler-Explorer-Build-gcc-48e8a7a677b8356df946cd12fbb215538828e747-binutils-2.36.1)
12.0.0 20210707 (experimental)
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
In godbolt gcc 11.0.1 20210408:
int main() {
auto f = [](int
: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
#include
template void f(T x) {
std::same_as auto y = x;
}
int main() { f(1); }
In file included from :1:
: In instantiation of
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
template
constexpr bool f(char d) {
return 'a' <= c && c <= 'z' ? (d | 0x20) == c :
'
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95349
--- Comment #12 from Ed Catmur ---
(In reply to Richard Biener from comment #11)
> Note that for C++ types you can apply memcpy to the placement new is not
> needed since object re-use terminates lifetime of the previous object and
> starts lifet
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95349
--- Comment #9 from Ed Catmur ---
(In reply to Jonathan Wakely from comment #4)
> I don't know the answer, and I don't know why it's useful to try this anyway.
If I'm reading P0593 correctly (I may not be), this would be a valid
implementation o
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
void f(int i) {
bool b = false;
if (i == 99 ? (b = true) : false)
;
}
warning: suggest parentheses around
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82099
Ed Catmur changed:
What|Removed |Added
CC||ed at catmur dot uk
--- Comment #6 from Ed
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36566
--- Comment #11 from Ed Catmur ---
(In reply to rene.rahn from comment #10)
> I know this is quite old now. But can someone explain me why using `#pragma
> pack(push, 1)` does work then?
`#pragma pack` has sharper edges. It will let you take un
: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ed at catmur dot uk
Target Milestone: ---
when indexing a char array initialized from a string literal in constexpr
context:
struct S1 { char c[6] {'h', 'e
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80667
--- Comment #3 from Ed Catmur ---
Agreed, gcc is OK since 7.2, selecting the latter partial specialization (as
with -std=c++14). OK to mark as fixed.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80871
Ed Catmur changed:
What|Removed |Added
CC||ed at catmur dot uk
--- Comment #2 from Ed
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80871
--- Comment #3 from Ed Catmur ---
Sorry. See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80438
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80438
Ed Catmur changed:
What|Removed |Added
CC||ed at catmur dot uk
--- Comment #2 from Ed
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66476
Ed Catmur changed:
What|Removed |Added
Status|REOPENED|RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66476
Ed Catmur changed:
What|Removed |Added
Status|RESOLVED|REOPENED
Resolution|INVALID
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425
Ed Catmur changed:
What|Removed |Added
CC||ed at catmur dot uk
--- Comment #34 from Ed
89 matches
Mail list logo