[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 &f(); } namespace N2 { struct N1 { floa

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

[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: > https://gcc.gnu.org/legacy-ml/gcc-patches/2

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

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

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

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

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

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

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

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

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

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

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

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

[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++/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/56528] New: __attribute__((visibility)) ignored for a function declaration with an asm label

2013-03-04 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56528 Bug #: 56528 Summary: __attribute__((visibility)) ignored for a function declaration with an asm label Classification: Unclassified Product: gcc Version: unknown

[Bug c++/56582] New: ICE on negative array index in C++11 constant expression evaluation

2013-03-09 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56582 Bug #: 56582 Summary: ICE on negative array index in C++11 constant expression evaluation Classification: Unclassified Product: gcc Version: 4.8.0 Status: U

[Bug c++/54526] [C++11] <:: is incorrectly treated as digraph <: followed by colon

2012-10-27 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54526 --- Comment #4 from Richard Smith 2012-10-28 05:21:40 UTC --- The fix does not appear to be correct. C++11 changed the lexing rules, not the parsing rules for template argument lists. For instance, this is valid in C++11: int a; bool b

[Bug c++/36486] g++ accepts code with ambiguous overloading

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

[Bug c++/57346] New: g++ prematurely rejects references to local variables that are not odr-uses from local classes inside templates

2013-05-20 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 g++ has a rejects-valid on this: template int f() { T n = 0; struct X

[Bug c++/57319] [4.8 Regression]: bogus "defaulted move assignment for ... calls a non-trivial move assignment operator for virtual base ..."

2013-05-23 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57319 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/57566] New: [C++11][constexpr] static temporaries bound recursively in reference constant expressions don't get initialized

2013-06-07 Thread richard-gccbugzilla at metafoo dot co.uk
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 If a temporary is lifetime-extended by being bound to a reference wit

[Bug c++/57745] New: missing recursive lifetime extension within std::initializer_list

2013-06-27 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 Consider: #include struct A { A() { std::cout << " A()" << std::endl; } ~A() { std::cout << "~A()" &

[Bug c++/55425] constexpr does not work in many situations (both built-in and user supplied literals)

2013-06-30 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55425 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/57588] [C++11] static constexpr in class fails to link

2013-06-30 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57588 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/57942] g++-4.8.1 tries to instantiate wrong constructor (C++11)

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

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

2013-08-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 Given struct S { mutable int n; constexpr S() : n() {} }; GCC correctly accepts: constexpr S s {}; but incorrectly rejects

[Bug c++/52036] C++11 allows template parameters to have internal linkage

2013-08-09 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52036 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/58328] [C++11] bogus: error: constructor required before non-static data member for

2013-09-05 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58328 Richard Smith changed: What|Removed |Added CC||jason at gcc dot gnu.org,

[Bug c++/32534] gcc fails to initialize template's static data members before their use in some cases

2011-11-03 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32534 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla at

[Bug c++/50986] New: weak static data members with constant initializers emitted in .rodata, leading to segfault on startup

2011-11-03 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50986 Bug #: 50986 Summary: weak static data members with constant initializers emitted in .rodata, leading to segfault on startup Classification: Unclassified Product: gcc Version: 4.

[Bug libstdc++/53578] New: include/ext/concurrence.h relies on ill-formed narrowing conversions

2012-06-04 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53578 Bug #: 53578 Summary: include/ext/concurrence.h relies on ill-formed narrowing conversions Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRME

[Bug c++/50986] weak static data members with constant initializers emitted in .rodata, leading to segfault on startup

2012-02-01 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50986 --- Comment #2 from Richard Smith 2012-02-01 21:14:35 UTC --- As noted in comment#0, I believe there is no ODR violation here. Each definition of U::k consists of the same sequence of tokens, every name refers to the same entity in both definitio

[Bug libstdc++/52119] numeric_limits::min() is not a constant expression

2012-02-03 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52119 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla at

[Bug c++/52130] New: missing check for matching underlying type during instantiation of enum member of class template

2012-02-05 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52130 Bug #: 52130 Summary: missing check for matching underlying type during instantiation of enum member of class template Classification: Unclassified Product: gcc Version: 4.7.0

[Bug c++/52119] numeric_limits::min() is not a constant expression

2012-02-13 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52119 --- Comment #8 from Richard Smith 2012-02-13 22:17:27 UTC --- Signed left shift which overflows the corresponding unsigned type is still undefined, so g++ should reject this: constexpr int n = 2 << 31;

[Bug c++/58752] [C++11] Bogus error: ambiguous class template instantiation

2013-11-11 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58752 --- Comment #7 from Richard Smith --- (In reply to Daniel Krügler from comment #6) > (In reply to Richard Smith from comment #4) > Richard, could you please explain what precisely you meant with: > > "Deducing #1 from #2 gives T=const U, which re

[Bug c++/59056] enable_if turns a non-ambiguous template into an ambiguous one

2013-11-13 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59056 --- Comment #5 from Richard Smith --- (In reply to Jonathan Wakely from comment #2) > I thought if the partial specializations were ambiguous then these function > overloads should be too. Yes, this inconsistency is very surprising. GCC, EDG, and

[Bug c++/59056] ambiguous call to function template overloads not diagnosed

2013-11-13 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59056 --- Comment #8 from Richard Smith --- (In reply to Walter Mascarenhas from comment #7) > In itself, Richard's paragraph "Morally, the function should ambiguous... " > implies that the code below is ambiguous. However, it > compiles just fine with

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

2013-12-02 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: void f() {} template struct X {}; template struct Y {}; constexpr void (*p)() = &f; X a; const

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

2013-12-02 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59372 --- Comment #1 from Richard Smith --- (In reply to Richard Smith from comment #0) > X c; > X d; Sorry, transcription error, these should be 'Y', not 'X'.

[Bug c++/59426] __has_trivial_{copy/assign} behavior differs from documentation

2013-12-09 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59426 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla@metafoo

[Bug c++/59465] New: g++ allows direct-initialization of an array of class type from another array in a mem-initializer

2013-12-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 Reduced testcase: struct string {} a[1]; struct pair { string s[1]; pair() : s(a) {} }; This is ill

[Bug c++/59673] New: wrong specialization used when a partial specialization of a member template is explicitly specialized

2014-01-03 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: template struct X { template struct Y; template struct Y { int x

[Bug c++/51433] New: constexpr caching leads to incorrect dynamic initialization

2011-12-05 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51433 Bug #: 51433 Summary: constexpr caching leads to incorrect dynamic initialization Classification: Unclassified Product: gcc Version: 4.6.2 Status: UNCONFIRMED

[Bug c++/51541] New: ICE on ill-formed alias template declarations

2011-12-13 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51541 Bug #: 51541 Summary: ICE on ill-formed alias template declarations Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Prio

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

[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 &&r = 0; int *p = &r; GCC mangles the lifetime-extended temporary as _ZGR1r0, which doesn

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

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

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

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

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

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

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

[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

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

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

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

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

[Bug libstdc++/53841] [C++11] condition_variable::wait_until() fails with high resolution clocks

2012-11-14 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53841 Richard Smith changed: What|Removed |Added CC||richard-gccbugzilla at

[Bug libstdc++/56158] New: bad enum values computed by operator~ in ios_base.h

2013-01-30 Thread richard-gccbugzilla at metafoo dot co.uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56158 Bug #: 56158 Summary: bad enum values computed by operator~ in ios_base.h Classification: Unclassified Product: gcc Version: unknown Status: UNCONFIRMED Severity: nor

[Bug c++/69763] New: _Alignof(double) in C gives different results from alignof(double) in C++

2016-02-10 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: --- See also bug 52023. On i386, according to GCC we have _Alignof(double) == 4, but according to G++ we have alignof

[Bug c++/69763] _Alignof(double) in C gives different results from alignof(double) in C++

2016-02-11 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69763 --- Comment #3 from Richard Smith --- I'm pretty sure neither the C nor C++ committees intended for alignof(T) to give different results in the different languages. And even with the rule in [basic.align]p2, GCC can still choose to specify that t

[Bug c++/57433] Local classes have an associated namespace

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

[Bug c++/57745] missing recursive lifetime extension within std::initializer_list

2016-06-08 Thread richard-gccbugzilla at metafoo dot co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57745 --- Comment #3 from Richard Smith --- Yes, this is now fixed; the remaining difference is a defect in the standard.

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

[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: https://github.com/gcc-mirror/gcc/blob/master/libibert

[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 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] 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++/78966] Unjustified variadic template instantiation

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

[Bug c++/79329] New: bogus operator delete access check during instantiation of new-expression

2017-02-01 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 { A(); void *operator new(unsigned long, void*); private: void operator delete(void

  1   2   >