[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
: 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(x);

[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

[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++/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++/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++/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 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++/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++/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 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

[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 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 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++/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++/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++/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
: 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 struct

[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",

[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 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

[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 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++/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++/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

[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++/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 'const

[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

[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

[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/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++/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++/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++/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++/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++/96876] New: missing check for destructibility of base classes in aggregate initialization

2020-08-31 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 Target Milestone: --- GCC accepts this invalid code (which is ill-formed because [dcl.init.aggr]/8 says it potentially-invokes

[Bug c/96788] "integer constant is so large that it is unsigned" warning is incorrect

2020-08-26 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96788 --- Comment #4 from Richard Smith --- (In reply to Richard Smith from comment #3) > such a literal "has no type" in C, which presumably results in undefined > behavior Ah, no, C11 6.4.4/2 makes this a constraint violation. But either way I

[Bug c/96788] "integer constant is so large that it is unsigned" warning is incorrect

2020-08-26 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96788 --- Comment #3 from Richard Smith --- In the mean time, what is GCC's intent here? Clang is following the behavior described by GCC's diagnostic text, treating decimal integer literals that don't fit in 'long long' but do fit in 'unsigned long

[Bug c/96788] New: "integer constant is so large that it is unsigned" warning is incorrect

2020-08-25 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 Target Milestone: --- Testcase: typedef __typeof(9223372036854775808LL) T; produces the warning: :1:18: warning: intege

[Bug c++/96719] New: non-standard handling of alias templates used as template template arguments

2020-08-19 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 Target Milestone: --- template struct A { using type = U; }; template using B = A; template class Z> struct Q { using t

[Bug c++/96604] New: rejects-valid on befriending specialization of conversion function template

2020-08-13 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 Target Milestone: --- Testcase: struct A { template operator T(); }; struct X {}; struct B { friend A::operator X(); }; Per [temp.mem

[Bug c++/96223] DR 1787 and indeterminate values in constexpr context

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

[Bug c++/59978] C++11 Non-Type-Template-Parameter Pack Expansion not working according to standard

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

[Bug c++/95349] Using std::launder(p) produces unexpected behavior where (p) produces expected behavior

2020-06-15 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95349 --- Comment #37 from Richard Smith --- (In reply to Richard Biener from comment #36) > The main issue I see is that this differing expectations of C and C++ are > impossible to get correct at the same time. That is a rather bold claim. I think

[Bug c/95630] New: rejects-valid on comparison of pointers to complete vs incomplete types in C11 mode

2020-06-10 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: --- Testcase: int f(int (*p)[], int (*q)[3]) { return p < q; } This is a constraint violation in

[Bug c++/95536] New: tag name injection doesn't happen for return type of a friend

2020-06-04 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: --- Testcase: struct A { friend struct B *f(); }; B *p; GCC rejects this saying that 'B' is not declared, which

[Bug c++/95349] Using std::launder(p) produces unexpected behavior where (p) produces expected behavior

2020-05-29 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95349 --- Comment #20 from Richard Smith --- (In reply to Andrew Downing from comment #19) > Not that it would make a difference in this particular situation, but is the > intent of P0593R6 to only allow implicitly creating an object in the >

[Bug c++/95349] Using std::launder(p) produces unexpected behavior where (p) produces expected behavior

2020-05-29 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95349 --- Comment #18 from Richard Smith --- (In reply to Andrew Downing from comment #17) > Also none of the behavior described in p0593 is required for this C++ > program to be well defined. All objects that are required to exists here are >

[Bug c++/95349] Using std::launder(p) produces unexpected behavior where (p) produces expected behavior

2020-05-29 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95349 --- Comment #16 from Richard Smith --- Per p0593, memcpy implicitly creates objects (of any implicit lifetime type) in the destination. It does not propagate the objects in the source memory to the destination memory, and can therefore be used

[Bug c++/94676] New: constexpr destructors run too late for temporaries created inside __builtin_constant_p

2020-04-20 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: --- Testcase: struct A { int *p; constexpr ~A() { *p = 0; } }; static_assert

[Bug c++/94569] alignas(object) with a weaker (smaller) alignment than the alignas(type) of it's type compiles, inconsistent with the C++ standard

2020-04-14 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94569 --- Comment #4 from Richard Smith --- (In reply to Richard Biener from comment #3) > But isn't the alignas(32) also "appertaining to that entity"? No. The alignas(32) appertains to the struct. This is specified in [class]/2: "The optional

[Bug c++/94569] alignas(object) with a weaker (smaller) alignment than the alignas(type) of it's type compiles, inconsistent with the C++ standard

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

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

2020-03-24 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94295 --- Comment #6 from Richard Smith --- (In reply to Marc Glisse from comment #5) > Ah, since you are here, and you appeared as an author of N3664 but not N3537 > (precisely when this subtlety happened), could you explain why? It isn't > discussed

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

2020-03-24 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94295 --- Comment #4 from Richard Smith --- (In reply to Andrew Pinski from comment #3) > PR 23383 is where part of the discussion was done. > > In fact GCC implements the optimization without the builtin: >

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

2020-03-24 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94295 --- Comment #2 from Richard Smith --- (In reply to Marc Glisse from comment #1) > (In reply to Richard Smith from comment #0) > > The C++ language rules do not permit optimization (eg, deletion) of direct > > calls to 'operator new' and

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

2020-03-23 Thread richard-gccbugzilla at metafoo dot co.uk
: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: richard-gccbugzilla at metafoo dot co.uk Target Milestone: --- See https://bugs.llvm.org/show_bug.cgi?id=45287 for some background. The C++ language rules do not permit

[Bug c++/94227] New: ambiguous lookup for nested-name-specifier in using-declaration is not diagnosed

2020-03-19 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: namespace N1 { int (); } namespace N2 { struct N1 { float

[Bug c++/92169] crash on referring to a local class member by unqualified name from outside the enclosing function

2020-01-30 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92169 --- Comment #4 from Richard Smith --- Aha! godbolt.org implicitly adds -g to its command line. Try that; that causes a crash for this testcase for me with GCC 9.2.1.

[Bug c++/92169] crash on referring to a local class member by unqualified name from outside the enclosing function

2020-01-28 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92169 --- Comment #2 from Richard Smith --- Still crashes GCC trunk from today: https://godbolt.org/z/zWvT4w

[Bug c++/92271] New: for consistency, __is_same_as should be named __is_same

2019-10-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: --- The convention for type trait builtins adopted by essentially every C++ compiler vendor is to expose std::SOME_TRAIT::value

[Bug c++/92169] New: crash on referring to a local class member by unqualified name from outside the enclosing function

2019-10-21 Thread richard-gccbugzilla at metafoo dot co.uk
: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: richard-gccbugzilla at metafoo dot co.uk Target Milestone: --- [Probably no-one will ever write code like this outside a compiler test case

[Bug c++/87150] [8 Regression] move ctor wrongly chosen in return stmt (derived vs. base)

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

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

2019-06-20 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67898 --- Comment #2 from Richard Smith --- (Clang trunk now accepts both testcases.)

[Bug c++/86501] shadow template parameter

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

[Bug c++/90792] incorrect mangling for beginning with an

2019-06-09 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90792 --- Comment #3 from Richard Smith --- (In reply to Andrew Pinski from comment #2) > Related to the upstream ABI issue: > https://github.com/itanium-cxx-abi/cxx-abi/issues/38 I don't think so, except that they're both about the 'sr' mangling in

[Bug c++/90792] New: incorrect mangling for beginning with an

2019-06-08 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 Target Milestone: --- Imported from https://llvm.org/PR14117 template struct IsConvertible { static const bool value =true; }; template struct EnableIf

[Bug libstdc++/90266] missing or broken check for vector::size() exceeding max_size()

2019-04-26 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90266 Richard Smith changed: What|Removed |Added Version|unknown |8.3.0 --- Comment #3 from Richard Smith

[Bug libstdc++/90266] New: missing or broken check for vector::size() exceeding max_size()

2019-04-26 Thread richard-gccbugzilla at metafoo dot co.uk
Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: richard-gccbugzilla at metafoo dot co.uk Target Milestone: --- Testcase: #include using T = int; size_t e() { std::vector vb; return vb.max_size(); } size_t f

[Bug c++/90107] New: rejects-valid on global-namespace-qualified variable declared after class definition

2019-04-15 Thread richard-gccbugzilla at metafoo dot co.uk
Keywords: rejects-valid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: richard-gccbugzilla at metafoo dot co.uk Target Milestone: --- GCC rejects these valid examples, producing a bogus "exp

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

2019-03-18 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58074 --- Comment #11 from Richard Smith --- The point of trivial (as distinguished from trivially-copyable) is that an instance of type T can be created and "properly" initialized (albeit left with an indeterminate value) without executing any code.

[Bug c++/89600] New: rejects-valid on dependent block-scope using declaration

2019-03-05 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 rejects this valid code: template T f() { using T::Bar; return Bar; } As follows: : In function 'T f()': :2:39: error: 'T

[Bug c++/89001] New: g++ uses wrong mangling for lifetime-extended temporaries

2019-01-22 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: inline int & = 0; int *p = GCC mangles the lifetime-extended temporary as _ZGR1r0, which doesn't match the

[Bug c++/86049] Array bindings are not const when initializer is

2018-12-11 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86049 --- Comment #5 from Richard Smith --- This was just reported as http://lists.isocpp.org/core/2018/12/5320.php; I don't believe it's on the core issues list yet. [@Tomalak, I think the standard is clear here: "If the assignment-expression in

[Bug c/88382] New: undocumented GNU C extension: C++ raw string literals permitted in GNU C

2018-12-05 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 Target Milestone: --- GCC's documentation of GNU C extensions appears not to mention allowing raw string literals in C, which GCC has

[Bug middle-end/87237] __atomic_load on 4-byte-sized, 1-byte-aligned struct is not atomic

2018-09-11 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87237 --- Comment #4 from Richard Smith --- (In reply to Alexander Monakov from comment #3) > With GCC size/align are 3/1 while with Clang it's 4/4 as you said Oh sorry, you're right, I'd forgotten about this ABI discrepancy. We really need to get

[Bug middle-end/87237] __atomic_load on 4-byte-sized, 1-byte-aligned struct is not atomic

2018-09-11 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87237 --- Comment #2 from Richard Smith --- (In reply to Alexander Monakov from comment #1) > GCC assumes the access is sufficiently aligned for an atomic object of > corresponding type I think that's only true for objects whose size corresponds to

[Bug c++/59372] accepts-invalid with constexpr function pointer variable as non-type template argument

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

[Bug c/87237] New: __atomic_load on 8-byte-sized, 1-byte-aligned struct is not atomic

2018-09-05 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: --- It's my understanding that __atomic_load is supposed to work for an essentially arbitrary TYPE, including the case where

[Bug c++/87097] New: value-initialization of an array of more than 1 element not treated as a constant initializer

2018-08-24 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: --- Live testcase: https://godbolt.org/z/1JYWJS For posterity: struct A { constexpr

[Bug c/86983] New: documentation inconsistent with always_inline diagnostics for computed goto

2018-08-16 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 Target Milestone: --- Per https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html a function containing a computed goto can

[Bug c++/86849] g++ applies guaranteed copy elision to delegating construction, resulting in miscompiles

2018-08-06 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86849 --- Comment #1 from Richard Smith --- Interestingly, GCC does appear to suppress guaranteed copy elision if the class has virtual base classes. Perhaps GCC's approach to this problem is to assume that a function returning a T by value cannot

[Bug c++/86849] New: g++ applies guaranteed copy elision to delegating construction, resulting in miscompiles

2018-08-03 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: --- Live testcase: https://godbolt.org/g/AKn7j7 For posterity: #include struct

[Bug c++/86769] g++ destroys condition variable in for statement too early

2018-07-31 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86769 --- Comment #1 from Richard Smith --- For easy reproduction: https://godbolt.org/g/dfZFxz This does not appear to be a regression: this example appears to be miscompiled by every version of GCC back to at least 4.1.

[Bug c++/86769] New: g++ destroys condition variable in for statement too early

2018-07-31 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: --- Testcase: struct X { ~X(); operator bool(); }; void f(X &); void g() { for (; X x = X(); f(x)); } GCC miscomp

[Bug c++/86049] Array bindings are not const when initializer is

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

[Bug c++/76995] type-id/expression in cstyle-cast are disambiguated incorrectly

2018-04-15 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=76995 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/84414] miscompile due to assuming that object returned by value cannot alias its own member pointer values

2018-02-15 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84414 --- Comment #2 from Richard Smith --- > Where does the scope of object A inside Foo begin and end? There is formally only one object. The object constructed in the return statement of Foo is simply the same object that is named 'a' within Bar.

[Bug c++/84414] New: miscompile due to assuming that object returned by value cannot alias its own member pointer values

2018-02-15 Thread richard-gccbugzilla at metafoo dot co.uk
: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: richard-gccbugzilla at metafoo dot co.uk CC: timshen at gcc dot gnu.org Target Milestone: --- GCC (all versions) miscompiles

[Bug c++/60352] [C++11] Bogus "error: conflicting declaration 'auto i'"

2017-12-08 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60352 --- Comment #3 from Richard Smith --- This bug still exists in GCC trunk.

[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++/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++/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++/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++/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++/52130] missing check for matching underlying type during instantiation of enum member of class template

2017-08-18 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52130 --- Comment #3 from Richard Smith --- The diagnostic in #1 is not only wrong for this case, it's also a rejects-valid in the case where the underlying types match. I've filed https://gcc.gnu.org/PR81895 for that.

[Bug c++/81895] New: gcc rejects out-of-line definition of enum member of class template under -pedantic-errors

2017-08-18 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: --- g++ -std=c++11 -pedantic-errors has a rejects-valid on this: template struct S { enum class E

[Bug c++/81145] bogus "dereferencing type-punned pointer will break strict-aliasing rules" diagnostic with incomplete class type

2017-06-20 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81145 --- Comment #5 from Richard Smith --- Yes, according to godbolt this occurs in GCC 4.4 - 7.1, but not in trunk. Unlike PR80593, it does not appear to be a GCC 7 regression, but it sure seems plausible that that change fixed it =)

[Bug c++/81145] bogus "dereferencing type-punned pointer will break strict-aliasing rules" diagnostic with incomplete class type

2017-06-20 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81145 --- Comment #2 from Richard Smith --- I've tried a few things and not found any way to get wrong code. I think you're right that this is just a diagnostic issue.

[Bug c++/81145] New: bogus "dereferencing type-punned pointer will break strict-aliasing rules" diagnostic with incomplete class type

2017-06-20 Thread richard-gccbugzilla at metafoo dot co.uk
Version: 7.0.1 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: --- Testcase: struct B { int n; }; struct A #

[Bug demangler/80513] demangler walks past trailing nul in mangled name in a bunch of cases

2017-04-25 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80513 --- Comment #1 from Richard Smith --- While we're here, this check for overflow in consume_count is nonsense, and any decent optimising compiler is going to optimise away the overflow check:

[Bug demangler/80513] New: demangler walks past trailing nul in mangled name in a bunch of cases

2017-04-24 Thread richard-gccbugzilla at metafoo dot co.uk
Priority: P3 Component: demangler Assignee: unassigned at gcc dot gnu.org Reporter: richard-gccbugzilla at metafoo dot co.uk Target Milestone: --- Example mangled name where demangler walks past two nuls: $ echo '__thunk_16\0_\0_3foo' | c++filt virtual

[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<template typename> struct A; template typename> struct B;

  1   2   >