[Bug c++/79500] New: non-template deduction guides cause crash

2017-02-13 Thread richard-gccbugzilla at metafoo dot co.uk
++ 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

[Bug c++/79501] New: member deduction guide not recognized

2017-02-13 Thread richard-gccbugzilla at metafoo dot co.uk
++ 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

[Bug c++/79668] New: [c++1z] inconsistent handling of parameter matching in template template arguments

2017-02-21 Thread richard-gccbugzilla at metafoo dot co.uk
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

[Bug c++/65157] Unable to define a static template member function of a nested class as a friend of a sibling class.

2017-11-21 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65157 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/78724] Incorrect ambiguous reference error when template class was forward declarated as a friend

2017-11-21 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78724 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/64816] gcc claims that constructor is private when it should be accessible

2017-11-21 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64816 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/81347] g++ confused by namespaces and friend classes

2017-11-21 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81347 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/59930] template friend declarations, namespaces, and explicit instantiations don't mix

2017-11-21 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59930 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/78083] New: wrong mangling for varargs lambdas

2016-10-22 Thread richard-gccbugzilla at metafoo dot co.uk
++ 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

[Bug c++/61105] New: [constexpr] accepts-invalid with new-expression in constant expression

2014-05-07 Thread richard-gccbugzilla at metafoo dot co.uk
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

[Bug c++/61161] New: wrong two-stage name lookup for overloaded operators

2014-05-12 Thread richard-gccbugzilla at metafoo dot co.uk
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<&

[Bug c++/51577] dependent name lookup finds operator in global namespace

2014-05-12 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51577 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/61161] wrong two-stage name lookup for overloaded operators

2014-05-12 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61161 Richard Smith changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/12944] [meta-bug] C++ name-lookup problems

2014-05-12 Thread richard-gccbugzilla at metafoo dot co.uk
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 ---

[Bug c++/10437] "using namespace" at global scope creates incorrect code

2014-05-12 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10437 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/21802] Two-stage name lookup fails for operators

2014-05-17 Thread richard-gccbugzilla at metafoo dot co.uk
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

[Bug c++/61351] New: ICE on valid when deducing template arguments with nested expansions of the same pack

2014-05-28 Thread richard-gccbugzilla at metafoo dot co.uk
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

[Bug c++/57573] [C++1y] bogus "taking address of temporary" error

2014-06-13 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57573 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/57644] [C++1y] Cannot bind bitfield to lvalue reference

2014-06-13 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57644 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/61402] [C++1y] Init-capture with side effect not working for some types

2014-06-13 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61402 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/42328] rejects valid friend

2015-03-27 Thread richard-gccbugzilla at metafoo dot co.uk
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

[Bug c++/59798] New: ICE befriending an inheriting constructor template specialization

2014-01-13 Thread richard-gccbugzilla at metafoo dot co.uk
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

[Bug c++/59937] New: [constexpr] bogus diagnostic "used in its own initializer"

2014-01-24 Thread richard-gccbugzilla at metafoo dot co.uk
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

[Bug c++/59389] [C++11] bogus error: call of overloaded ‘Foo()’ is ambiguous

2014-01-26 Thread richard-gccbugzilla at metafoo dot co.uk
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

[Bug c++/59950] New: Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary

2014-01-26 Thread richard-gccbugzilla at metafoo dot co.uk
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())

[Bug c++/59950] Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary

2014-01-26 Thread richard-gccbugzilla at metafoo dot co.uk
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.

[Bug c++/59989] New: ICE when a template parameter pack is explicitly specified for a function template and provides a complete argument list for a template

2014-01-29 Thread richard-gccbugzilla at metafoo dot co.uk
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

[Bug c++/54440] [c++11] g++ prematurely applying rule that a template parameter pack cannot be followed by a template parameter

2014-01-29 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54440 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/60497] New: unique_ptr tries to complete its type T even though it's not required to be a complete type

2014-03-10 Thread richard-gccbugzilla at metafoo dot co.uk
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

[Bug c++/60503] New: gcc looks for C++ attributes in the wrong place in a lambda-expression

2014-03-11 Thread richard-gccbugzilla at metafoo dot co.uk
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

[Bug c++/67772] New: wrong type_info emitted for cv-qualified pointer to member types

2015-09-29 Thread richard-gccbugzilla at metafoo dot co.uk
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

[Bug c++/67898] New: rejects-valid on overloaded function as non-type template argument of dependent type

2015-10-08 Thread richard-gccbugzilla at metafoo dot co.uk
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

[Bug c++/64665] Overload resolution not working with std::initializer_list and bool

2015-01-20 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64665 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c/64843] New: miscompilation of atomic_fetch_add on atomic pointer type

2015-01-28 Thread richard-gccbugzilla at metafoo dot co.uk
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)

[Bug c/64843] miscompilation of atomic_fetch_add on atomic pointer type

2015-01-28 Thread richard-gccbugzilla at metafoo dot co.uk
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(&_

[Bug c/64843] miscompilation of atomic_fetch_add on atomic pointer type

2015-01-28 Thread richard-gccbugzilla at metafoo dot co.uk
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

[Bug c++/64987] New: alignas(N) (and __attribute__(__aligned__(N))) ignored on enum specifiers

2015-02-09 Thread richard-gccbugzilla at metafoo dot co.uk
: 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

[Bug c++/62116] Allowing redeclaration of global variable x using ::x

2015-02-19 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62116 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/58408] [C++11] __thread + trivially_constructible -> error

2014-10-30 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58408 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug libstdc++/63860] Ill-formed std::pair::swap implementation?

2014-11-13 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63860 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/64178] New: rejects-valid on variadic operator++

2014-12-03 Thread richard-gccbugzilla at metafoo dot co.uk
++ 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

[Bug c++/42328] rejects valid friend

2014-12-03 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42328 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/58969] bogus error: the value of 'kName' is not usable in a constant expression

2014-12-10 Thread richard-gccbugzilla at metafoo dot co.uk
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

[Bug libstdc++/64276] New: would be better to use __cpp_exceptions rather than __EXCEPTIONS to determine whether exceptions are available

2014-12-11 Thread richard-gccbugzilla at metafoo dot co.uk
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

[Bug c++/61804] New: rejects-valid if parenthesized temporary is incremented

2014-07-14 Thread richard-gccbugzilla at metafoo dot co.uk
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())++; }

[Bug c++/59873] The value of char32_t U'\u0000' and char16_t u'\u0000' is 1, instead of 0.

2014-07-20 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59873 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/62310] New: fails to consider default initializers (NSDMIs) when checking inheriting constructors

2014-08-29 Thread richard-gccbugzilla at metafoo dot co.uk
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

[Bug c++/31176] reorder class data members to minimize space waste

2014-09-02 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31176 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/63149] New: can't initialize std::vector from auto-deduced type 'const std::initializer_list

2014-09-02 Thread richard-gccbugzilla at metafoo dot co.uk
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;

[Bug c++/63149] wrong auto deduction from braced-init-list

2014-09-02 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63149 Richard Smith changed: What|Removed |Added Summary|can't initialize|wrong auto deduction from

[Bug c++/58102] rejects valid initialization of constexpr object with mutable member

2014-09-15 Thread richard-gccbugzilla at metafoo dot co.uk
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

[Bug c++/68709] New: incorrectly requiring move-constructibility when list-initializing a polymorphic array element of a class member

2015-12-04 Thread richard-gccbugzilla at metafoo dot co.uk
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

[Bug c++/66477] New: [constexpr] accepts-invalid with constexpr member call on non-constant reference

2015-06-09 Thread richard-gccbugzilla at metafoo dot co.uk
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

[Bug c++/66478] New: [constexpr] accepts-invalid with read of non-constant variable as discarded value

2015-06-09 Thread richard-gccbugzilla at metafoo dot co.uk
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

[Bug c++/58074] [C++11] __is_trivial intrinsic fails for deleted members and for non-trivial copy-c'tors

2015-06-09 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58074 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/77379] New: incorrect mangling for non-virtual adjustor thunk (missing abi tag)

2016-08-25 Thread richard-gccbugzilla at metafoo dot co.uk
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

[Bug c++/99534] New: bogus UDL diagnostic for header-name followed by macro

2021-03-10 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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

[Bug c++/97358] [8/9/10 Regression] ICE while building firefox since r8-2720

2020-10-15 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97358 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c/98217] Prefer a warning for when VLAs declared on stack

2020-12-09 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98217 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/97222] GCC discards attributes aligned and may_alias for typedefs passed as template arguments

2020-09-28 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97222 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/97256] auto function return different result

2020-10-01 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97256 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/97256] auto function return different result

2020-10-01 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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.

[Bug c++/98804] GCC misparses template in pack expansion as comparison

2021-01-24 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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:

[Bug c++/98859] New: pedantic error on use of __VA_OPT__ before C++20 is unnecessary and counterproductive

2021-01-27 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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

[Bug c++/55120] Inaccessible virtual base constructor does not prevent generation of default constructor

2021-01-29 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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

[Bug c++/99176] New: GCC rejects const_cast of null pointer in constant expressions

2021-02-19 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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 '

[Bug c++/99209] New: lambdas in function template signatures instantiated with wrong semantic context

2021-02-22 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
: 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

[Bug c++/99209] lambdas in function template signatures instantiated with wrong semantic context

2021-02-22 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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

[Bug c++/100640] New: GCC permits explicit instantiation of a constructor template with an explicit template argument list

2021-05-17 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
: 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

[Bug c++/91292] Mangler incorrectly handles negative numbers in expressions

2021-09-24 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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

[Bug c++/108090] New: pack expansion of using declarations doesn't properly handle dependent conversion function names

2022-12-13 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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

[Bug c++/101370] New: miscompile of self-referential constexpr or constinit array initializer

2021-07-07 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
: 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

[Bug libstdc++/94295] use __builtin_operator_new and __builtin_operator_delete when available

2021-07-20 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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

[Bug c++/102071] New: crash when combining -faligned-new=N with array cookie

2021-08-25 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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

[Bug c++/110938] New: miscompile if implicit special member is deleted in a subtle way

2023-08-07 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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

[Bug c++/110938] [11/12/13/14 Regression] miscompile if implicit special member is deleted and mutable

2023-08-08 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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?

[Bug c++/111633] New: __restrict on a member function is permitted in an inconsistent location relative to ref-qualifiers

2023-09-28 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
: 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

[Bug c++/109337] c++2a test concepts4.C passes when it should fail

2023-03-29 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109337 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/109422] New: wrong depth used for template parameter mangling for lambdas in function signatures

2023-04-05 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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

[Bug c++/109422] wrong depth used for template parameter mangling for lambdas in function signatures

2023-04-05 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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__.

[Bug c++/100825] function signature constraints are not a part of mangled name

2023-04-07 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100825 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug libstdc++/109442] Dead local copy of std::vector not removed from function

2023-04-16 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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

[Bug libstdc++/109442] Dead local copy of std::vector not removed from function

2023-04-17 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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

[Bug c++/109654] New: unnecessary "cannot bind packed field to reference" error when referenced type has aligned(1) attribute

2023-04-27 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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

[Bug c++/109654] unnecessary "cannot bind packed field to reference" error when referenced type has aligned(1) attribute

2023-04-28 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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

[Bug c++/111923] default argument is not treated as a complete-class context of a class

2023-10-24 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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

[Bug c++/112455] New: befriending a lambda closure type doesn't grant access to the lambda body

2023-11-09 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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

[Bug c++/110101] New: inconsistent behavior for array-to-pointer decay in constant evaluation in template argument

2023-06-02 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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

[Bug c++/31584] [DR502] nested enum not considered dependent

2023-06-04 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31584 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug libstdc++/115497] [15 Regression] __is_pointer doesn't compile with clang since 014879ea4c86b3b8ab6b61a1226ee5b31e816c8b

2024-06-18 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115497 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug libstdc++/115497] [15 Regression] __is_pointer doesn't compile with clang since 014879ea4c86b3b8ab6b61a1226ee5b31e816c8b

2024-06-18 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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

[Bug c++/105864] storing nullptr_t to memory should not generate any instructions

2024-11-21 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105864 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/118461] New: constexpr lifetime tracking allows access to out-of-lifetime const variables

2025-01-13 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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

[Bug c++/118462] New: constexpr lifetime tracking mishandles variables whose scope is reentered

2025-01-13 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
: 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

[Bug c++/118461] constexpr lifetime tracking allows access to out-of-lifetime const variables

2025-01-13 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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

[Bug c++/119654] New: name lookup after `typename` incorrectly ignores non-type non-namespace names

2025-04-06 Thread richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs
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

<    1   2