++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
Testcase:
template struct A {};
A(...) -> A;
A a = {};
results in:
:3:8: internal compiler error: tree check: expected template_decl, have
function_decl
++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
struct X {
template struct A {};
A() -> A;
};
... results in:
:3:10: error: ISO C++ forbids declaration of 'A' with no type
[-fpermissiv
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
Consider the following:
template typename> struct A;
template typename> struct B;
template struc
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65157
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78724
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64816
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81347
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59930
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
Testcase:
inline int f() {
auto a = [](...) { static int n; return ++n; };
auto b = []() { static int n; return ++n; };
return a() + b();
}
int k = f();
The
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
G++ accepts this ill-formed code:
using size_t = decltype(sizeof(0));
constexpr void *operator new(size_t, int*) noexcept { return nullptr
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
GCC rejects-valid on this:
struct T {
template void f(const T &v) {
0 << v;
}
};
namespace N {
struct X {};
struct Y : X {};
void operator<&
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51577
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61161
Richard Smith changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12944
Bug 12944 depends on bug 61161, which changed state.
Bug 61161 Summary: wrong two-stage name lookup for overloaded operators
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61161
What|Removed |Added
---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10437
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=21802
--- Comment #4 from Richard Smith ---
EDG accepts this (which I believe is the correct answer). Clang and GCC reject
(in Clang's case, the callee is resolved in the template definition, but then
ADL is accidentally performed during template insta
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Testcase:
template struct X {};
template void foo(X... a);
void test() { foo(X(), X()); }
Result in:
: In
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57573
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57644
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61402
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42328
--- Comment #9 from Richard Smith ---
Yes, I think this is ill-formed (although the standard is very unclear about
this). I think the declaration
template friend void freeList::foo();
would declare the member 'foo' of the class template parti
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
This:
struct A { template A(T); };
struct B : A { using A::A; };
struct C { friend B::B(int); };
B b(0);
gives this:
:3:21: internal
ty: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
GCC rejects this:
constexpr const char * const &r = "";
constexpr const char * const &s = r;
with this bogus diagnostic
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59389
--- Comment #5 from Richard Smith ---
Under [over.best.ics]p4, I think both the original example in comment#0 and the
example in comment#2 are valid (so GCC is incorrect to reject both and Clang is
incorrect to reject #2).
The user-defined conver
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
GCC rejects this valid code:
struct Foo {};
int f(Foo *p);
int n = f(&(Foo() = Foo())
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59950
--- Comment #1 from Richard Smith ---
Additional clarification was requested: "Foo() = Foo()" means
"Foo().operator=(Foo())". The 'operator=' has return type 'Foo&', thus that
expression is not a temporary.
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
GCC ICEs on this:
template struct X {};
template
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54440
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
IRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Consider:
struct A;
template struct B { T t; };
struct Deleter { void operator()(B*) const; };
std::uniqu
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
GCC accepts this ill-formed code:
void f() { []() [[ ]] mutable noexcept {}; }
... and rejects this valid code:
void f
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
Consider:
namespace std { struct type_info {}; }
struct A {};
auto x = typeid(void(A::*)() const);
Clang emits the
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
Test case:
void f(int);
void f(float);
template struct X {};
template void test() { X
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64665
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
#include
int *_Atomic p;
void f() { atomic_fetch_add(&p, 1); }
gives
pushq%rbp
movq%rsp, %rbp
lock addq$1, p(%rip)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64843
--- Comment #2 from Richard Smith ---
libstdc++ uses these builtins in bits/atomic_base.h:
__pointer_type
fetch_add(ptrdiff_t __d,
memory_order __m = memory_order_seq_cst) noexcept
{ return __atomic_fetch_add(&_
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64843
--- Comment #5 from Richard Smith ---
(In reply to jos...@codesourcery.com from comment #3)
> The first question is whether this code is actually valid.
To my reading, the C11 standard says that these operations must work on all
atomic integer t
: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Testcase:
enum alignas(16) E {};
E e;
GCC fails to align 'e' to 16 bytes.
The same issue exists for __attribute__((__al
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62116
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58408
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63860
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
GCC rejects this code, which I think is valid:
template void operator++(T...);
struct X {};
void f(X x) { ++x; x++; }
Here, f should call operator++ then operator++. GCC says:
:1:45: error
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42328
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58969
--- Comment #2 from Richard Smith ---
(In reply to Kai Tietz from comment #1)
> Hmm, issue seems to be in too restrictive decl_maybe_constant_var_p function.
I don't know how the GCC code is structured, but I don't think that's right;
that funct
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
CC: redi at gcc dot gnu.org
libstdc++ uses __EXCEPTIONS to
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Related to PR56239, GCC rejects valid on this:
struct T { void operator++(int); };
void f() { (T())++; }
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59873
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Consider:
struct A { A(int); A() = delete; };
struct B { B(int); B() = delete; };
struct C : B { using B::B; A a = 0; } c(0
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31176
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Reduced testcase:
namespace std {
template struct initializer_list {
const T *p; unsigned long n;
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63149
Richard Smith changed:
What|Removed |Added
Summary|can't initialize|wrong auto deduction from
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58102
--- Comment #3 from Richard Smith ---
Thanks, that is (was) a Clang bug; I've just fixed it. And there's a standard
defect here too, as far as I can see:
union U { int a; mutable int b; };
constexpr U u1 = {1};
int k = (u1.b = 2);
conste
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
GCC incorrectly rejects this:
struct A { virtual ~A
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
GCC accepts this invalid code:
struct a { constexpr int size() const { return 3; } };
void f(a &a
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
GCC accepts this ill-formed code:
void f(int n) { static_assert((+n, true), ""); }
This
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58074
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
GCC does not emit ABI tags from a function return type when mangling an
adjustor thunk (see example in https://llvm.org
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
Testcase:
#define M
#include "foo.h"M
#include M
This produces two warnings
warning: invalid suffix on literal; C++11 requires a space betwe
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97358
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98217
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97222
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97256
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97256
--- Comment #6 from Richard Smith ---
My apologies, I misread the testcase. Yes, this is UB.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98804
--- Comment #1 from Richard Smith ---
Somewhat more reduced:
struct X { constexpr X(int&) {} };
template struct Y {};
int a;
auto h(int b) -> Y; // #1
auto h(int b) -> Y; // #2
GCC accepts #1, but for #2 it produces seven (!) error messages:
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
There's no good way in ISO C or C++ to express what the GNU ,##__VA_ARGS__
extension does prior t
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55120
--- Comment #11 from Richard Smith
---
(In reply to Jonathan Wakely from comment #10)
> It looks like Clang has a bug with the inaccessible constructor too, and
> strangely inconsistent handling of the inaccessible destructor.
Access checks are
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
GCC rejects:
constexpr const int *p = nullptr;
constexpr int *q = const_cast(p);
saying:
:2:20: error: conversion of '
: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
Testcase:
constexpr decltype(auto) f_adl(auto a) { return f(a); }
namespace A {
constexpr int f(auto
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99209
--- Comment #1 from Richard Smith ---
Here's a more interesting example: https://godbolt.org/z/83c36q
#include
constexpr char f(...) { return 'g'; }
constexpr decltype(auto) f_adl(auto a) { return f(a); }
namespace A {
constexpr char f(a
: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
Example:
struct A {
template A() {}
};
template A::A();
GCC accepts this without
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91292
--- Comment #7 from Richard Smith ---
(In reply to Patrick Palka from comment #3)
> Hmm, but according to
> http://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling.literal the
> mangling of a negative integer literal is prefixed with "n",
The
tatus: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
Testcase, which I believe is valid, and other compilers accept:
template stru
: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
Testcase (reduced from tcmalloc):
struct Elem {
Elem* next_ = this;
Elem* prev_ = this;
};
constinit
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94295
--- Comment #8 from Richard Smith ---
(In reply to Jonathan Wakely from comment #7)
> Richard S., is there any reason to use the built-ins for the constant
> evaluation case?
No, Clang's constant evaluator treats the built-ins and calls to repla
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
Testcase:
struct X { ~X(); int c; };
extern int n;
X *p = new X[n];
Compiling with -faligned-new=2 gives:
:3:15: internal compiler error: tree check
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
Testcase: https://godbolt.org/z/rKG8c166f
```
template struct Error {
//static_assert(false);
using type = T
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110938
--- Comment #4 from Richard Smith ---
Looks like the trait difference only happens if the templated constructor is
not deleted, but the ABI mismatch happens regardless. Possibly there are two
separate issues here?
: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
GCC permits __restrict-qualified member functions. When combined with
ref-qualifiers
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109337
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
Testcase:
struct C {
template
void f(decltype([](T, auto) { return 0; })) {}
};
void g() { C
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109422
--- Comment #1 from Richard Smith ---
> This should instead be mangled as T_TL__
Sorry, that's wrong; the rule we ended up with would mangle this as T_TL0__.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100825
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109442
--- Comment #14 from Richard Smith
---
If I understand correctly, you're looking for documentation that
__builtin_operator_new(size)
has the exact same semantics and permits the same optimizations as `::new T`
for a trivially-constructible
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109442
--- Comment #16 from Richard Smith
---
(In reply to Richard Biener from comment #15)
> I was specifically looking at C++20 7.6.2.7/10 to /14 (but maybe also
> others and of course the relevant parts of the delete expression). In
> particular t
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
As a workaround for people hitting #36566, I think GCC should accept
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109654
--- Comment #2 from Richard Smith ---
Hm, that doesn't explain why the second example I gave is accepted. But I
suppose what's happening there is probably just that the `packed` attribute is
ignored entirely for fields with alignment 1, so this
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111923
--- Comment #9 from Richard Smith ---
I don't think we intended for default arguments of class-scope lambdas to get
the same complete-class context treatment as default argument of member
functions, but the standard wording does currently seem t
erity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
Testcase:
class C;
auto x = [](MyC *p) {
return p->n;
};
class C {
int n;
friend decltype
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
Testcase:
template struct X {};
int arr[32];
constexpr void *id(void *p) { return p; }
void f
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31584
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115497
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115497
--- Comment #15 from Richard Smith
---
(In reply to Jonathan Wakely from comment #14)
> I assume clang doesn't have __is_arithmetic, __is_scalar and __is_void
> built-ins yet, because also defines class templates
> with those names.
Clang has
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105864
Richard Smith changed:
What|Removed |Added
CC||richard-gccbugzilla@metafoo
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
Even after the fix for PR96630, GCC still accepts this invalid code that
accesses a variable outside its
: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
Even after the fix for PR96630, GCC still accepts this invalid code that
accesses a variable outside its
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118461
--- Comment #1 from Richard Smith ---
See also PR118462 -- I'm not sure if these are duplicates or not; this one
requires the variable to be declared `const`. However, GCC does reject this
simplified testcase with a lifetime error:
constexpr in
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
Testcase:
template struct X { typedef int type; };
struct Y { typedef int type; };
void f() {
int X
101 - 196 of 196 matches
Mail list logo