[Bug c++/117004] New: Unexpected const variable type with decltype of non-type template parameter of deduced type

2024-10-07 Thread barry.revzin at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- This is similar to #99631, but this example deals with scalars and still fails on trunk. Attempted

[Bug c++/116896] New: codegen for <=> compared to hand-written equivalent

2024-09-29 Thread barry.revzin at gmail dot com via Gcc-bugs
ty: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider this example (https://godbolt.org/z/66sjx78ej): #include std::strong_ordering wat(int const& lhs, int const& rhs) { #ifdef MANUAL

[Bug c++/116696] function template not considered constexpr even with -fimplicit-constexpr

2024-09-13 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116696 --- Comment #5 from Barry Revzin --- Thanks!

[Bug c++/116696] New: function template not considered constexpr even with -fimplicit-constexpr

2024-09-12 Thread barry.revzin at gmail dot com via Gcc-bugs
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- I was trying to implement constexpr std::format as cheaply as possible — by using -fimplicit-constexpr instead of

[Bug c++/115163] New: Requesting better diagnostic for explicit constructor failure

2024-05-20 Thread barry.revzin at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Here's a simple program: struct C { explicit C(int); }; int main() { C c = 42; } gcc's error for this right now

[Bug c++/112490] infinite meta error in reverse_iterator::iterator>>

2024-04-05 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112490 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com

[Bug c++/114589] New: missed optimization: losing bool range information

2024-04-04 Thread barry.revzin at gmail dot com via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider the following example: template struct simple_optional { bool has_val; T val; auto begin() const -> T const* { return &val; }

[Bug sanitizer/71962] error: ‘((& x) != 0u)’ is not a constant expression

2024-03-25 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71962 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com

[Bug c++/114135] New: Diagnostic missing useful information for ranges code

2024-02-27 Thread barry.revzin at gmail dot com via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- This is an example using Ranges: #include #include using namespace std; int main() { auto rng = views::iota(0, 3); const auto [a, b] = * ranges

[Bug c++/104255] parsing function signature fails when it uses a function parameter outside of an unevaluated context

2024-02-26 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104255 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com

[Bug c++/114124] New: Rejected use of function parameter as non-type template parameter in trailing-return-type

2024-02-26 Thread barry.revzin at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Reduced from StackOverflow: template struct Constant { constexpr operator int() const noexcept

[Bug c++/49974] missing -Wreturn-local-addr for indirectly returning reference to local/temporary

2024-02-15 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49974 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com

[Bug c++/113008] New: Trivially default constructible requires default member initializer before the end of its enclosing class

2023-12-13 Thread barry.revzin at gmail dot com via Gcc-bugs
Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- This is related to bugs PR96645 and PR88165. Consider this: #include

[Bug libstdc++/112591] variant allows for creating multiple empty objects at same address

2023-11-17 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112591 --- Comment #1 from Barry Revzin --- Basically, in C++17, Sub looks like this: struct Sub17 : Empty { aligned_membuf storage; unsigned char index; }; But in C++20 it turns into: struct Sub20 : Empty { union { Empty storage; };

[Bug libstdc++/112591] New: variant allows for creating multiple empty objects at same address

2023-11-17 Thread barry.revzin at gmail dot com via Gcc-bugs
Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider: #include #include struct Empty { ~Empty() {} }; struct Sub : Empty { std::variant e; }; int main() { Sub

[Bug c++/112296] New: __builtin_constant_p doesn't propagate through member functions

2023-10-30 Thread barry.revzin at gmail dot com via Gcc-bugs
ormal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Here's a short example: using size_t = decltype(sizeof(0)); struct Span { int const* ptr; size_t len;

[Bug c++/111854] new (align_val_t) should be ill-formed

2023-10-17 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111854 --- Comment #4 from Barry Revzin --- The standard says this should be ill-formed.

[Bug c++/111854] New: new align_val_t usual deallocation

2023-10-17 Thread barry.revzin at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- gcc accepts this program (copied from the MSVC documentation for https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-2/compiler-error-c2956?view=msvc-170) without

[Bug c++/111538] New: Unhelpful message when returning initializer list when deducing the return type

2023-09-22 Thread barry.revzin at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider: auto f(bool c) { if (c) { return 2; } else { return {}; } } This code is ill

[Bug c++/111485] New: Constraint mismatch on template template parameter

2023-09-19 Thread barry.revzin at gmail dot com via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Reduced from StackOverflow (https://stackoverflow.com/q/77136297/2069064): template constexpr bool regular = true; template concept C = regular; template

[Bug c++/111299] New: lack of warning on dangling reference to temporary

2023-09-05 Thread barry.revzin at gmail dot com via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider the following reduced example: using size_t = decltype(sizeof(0)); template struct array { T elems[N]; auto data() -> T* { return el

[Bug c++/111158] New: diagnostics, colors, and std::same_as

2023-08-25 Thread barry.revzin at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider this broken example: #include template struct Optional { }; auto f() -> Optional; auto g() #ifdef CONCEPTS -> std::same_as> auto #else -&

[Bug c++/102609] [C++23] P0847R7 - Deducing this

2023-08-21 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102609 --- Comment #14 from Barry Revzin --- > I am finding myself realizing that implementing this as a member function and > turning off member function bits seems to be more difficult than implementing > it as a static function and implementing me

[Bug c++/110806] New: Suggest this-> for dependent base classes in more contexts

2023-07-25 Thread barry.revzin at gmail dot com via Gcc-bugs
mal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider this [broken] program: template struct Outer { struct Inner { template void wait(F f); }; str

[Bug c++/110793] New: regression in optimizing unused string

2023-07-24 Thread barry.revzin at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider this reduced, silly-looking example: #include inline int zero(std::string const& = {}) { return 0; } int main() { return zero(); } In several versions of

[Bug c++/109642] False Positive -Wdangling-reference with std::span-like classes

2023-06-21 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109642 --- Comment #10 from Barry Revzin --- Check out the report I opened for an example where the #pragma around the whole class isn't really enough anyway - since you might want to disable the warning for specializations of class/function templates.

[Bug c++/110358] New: requesting nicer suppression for Wdangling-reference

2023-06-21 Thread barry.revzin at gmail dot com via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- As everyone is already aware, Wdangling-reference gives false positives for reference-semantic classes. The compiler has special cases for the ones it knows about

[Bug c++/110231] New: unhelpful diagnostic when constructing through initializer_list

2023-06-12 Thread barry.revzin at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider this example: #include struct Point { int first; int second; }; struct Inner { Inner(std::initializer_list

[Bug c++/110064] New: spurious missing initializer for member for anonymous

2023-05-31 Thread barry.revzin at gmail dot com via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- This program (reduced from StackOverflow: https://stackoverflow.com/q/76375145/2069064): struct B { }; struct D : B { int x; int y; }; int main(int

[Bug libstdc++/109890] New: vector's constructor doesn't start object lifetimes during constant evaluation

2023-05-17 Thread barry.revzin at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- >From StackOverflow (https://stackoverflow.com/q/76269606/2069064), clang rejects this code when c

[Bug c++/109876] New: initializer_list not usable in constant expressions in a template

2023-05-16 Thread barry.revzin at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider this example: #include template struct Array { }; #ifdef USE_TEMPLATE template #endif struct Foo { static

[Bug c++/109715] New: abi_tag attribute is not applied to variable templates

2023-05-03 Thread barry.revzin at gmail dot com via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Given: template [[gnu::abi_tag("ABI")]] inline int value = 0; int get() { return value; } gcc mangles the variable value as _Z5valueIiE,

[Bug c++/109515] New: Diagnostic request: warning on out-of-order structured bindings names

2023-04-14 Thread barry.revzin at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider this example: struct div_t { int quot; int rem; }; auto div(int, int) -> div_t; int main() { auto [

[Bug libstdc++/109474] chunk_by doesn't work for ranges of proxy references

2023-04-11 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109474 --- Comment #2 from Barry Revzin --- Serves me right for only checking vector (which worked) and vector (which didn't) and not bothering to check vector const (which also doesn't work) and thus overly complicating the bug report. I got too exci

[Bug libstdc++/109474] New: chunk_by doesn't work for ranges of proxy references

2023-04-11 Thread barry.revzin at gmail dot com via Gcc-bugs
y: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Reduced example from Conor's tweet (https://twitter.com/code_report/status/1645831980473282560): #include #include void f(std::vector v) { au

[Bug c++/88061] section attributes of variable templates are ignored

2023-04-06 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88061 --- Comment #6 from Barry Revzin --- Any action on this one? A workaround right now is to change code that would ideally look like (which is pretty clean in my opinion): template void foo() { [[gnu::section(".meow")]] static int value = 0;

[Bug c++/109396] New: Winit-self doesn't warn when std::move()-d

2023-04-03 Thread barry.revzin at gmail dot com via Gcc-bugs
nt: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- In this example: #include struct A { int i_; A(int i) : i_(i_) { } }; struct B { int i_; B(int i) : i_(std::move(i_)) { } }; Compiling on gcc trunk

[Bug c++/109362] codegen adds unnecessary extra add when reading atomic member

2023-03-31 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109362 --- Comment #4 from Barry Revzin --- Awesome!

[Bug c++/109362] codegen adds unnecessary extra add when reading atomic member

2023-03-31 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109362 --- Comment #1 from Barry Revzin --- Sorry, in this reduced example, it doesn't actually consume an extra register - only rdi is used. In this slightly less reduced example: #include struct S { std::atomic size; std::atomic read_ptr

[Bug c++/109362] New: codegen adds unnecessary extra add when reading atomic member

2023-03-31 Thread barry.revzin at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- This program: #include struct S { long size; std::atomic read_ptr; auto peek() const -> const char* { ret

[Bug c++/109268] New: Guard variable still provided for static constinit variable

2023-03-23 Thread barry.revzin at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- This program: struct X { constexpr X() { } constexpr ~X() { } }; int main() { static constinit X data; } compiled on gcc

[Bug c++/109222] New: Confusing error for declaring an enum class with unknown type

2023-03-20 Thread barry.revzin at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- This program fails to compile (as it should, since the first line is commented out): // using i32 = int; enum class E : i32 { red

[Bug c++/108953] New: inefficient codegen for trivial equality

2023-02-27 Thread barry.revzin at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider this example: #include #include #include struct C { uint8_t a; uint8_t b; uint8_t c; uint8_t d; uint16_t e; uint16_t f; int32_t g; bool

[Bug libstdc++/108823] New: ranges::transform could be smarter with two sized ranges

2023-02-16 Thread barry.revzin at gmail dot com via Gcc-bugs
Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- >From StackOverflow (https://stackoverflow.com/q/75464599/2069064): #include #include #include #include #include #include

[Bug c++/108744] error message when trying to use structured bindings in static member declaration could be cleaner

2023-02-09 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108744 --- Comment #3 from Barry Revzin --- Yeah, they're banned in non-static data members also. But there, we just can't have any "auto" non-static data members, whereas you can have "auto" static data members (just not structured bindings).

[Bug c++/108744] New: error message when trying to use structured bindings in static member declaration could be cleaner

2023-02-09 Thread barry.revzin at gmail dot com via Gcc-bugs
: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider: struct X { int i, j; }; struct C { static auto [a, b] = X{1, 2}; }; This is

[Bug c++/105200] user-defined operator <=> for enumerated types is ignored

2022-12-30 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105200 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com

[Bug c++/106667] New: Diagnosing misuses of capturing lambda coroutines

2022-08-17 Thread barry.revzin at gmail dot com via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider the following example using std::generator from P2502 (sorry the example isn't super reduced, https://godbolt.org/z/b4vj7E7d1): int main() { int lo

[Bug c++/106631] New: Unhelpful diagnostic on variable template specialization with unknown name

2022-08-15 Thread barry.revzin at gmail dot com via Gcc-bugs
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Short example: template constexpr bool trait = true; template <> constexpr bool triat = false; Note the typo on

[Bug c++/106596] New: Not a helpful diagnostic when putting things out of order in a member function

2022-08-12 Thread barry.revzin at gmail dot com via Gcc-bugs
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider this example: template concept C = true; template struct Widget { void foo() requires C noexcept

[Bug c++/106371] New: Bogus narrowing conversion reported due to bitfield

2022-07-20 Thread barry.revzin at gmail dot com via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider: #include struct A { uint64_t x : 32; }; struct B { uint32_t x; }; void f() { auto a = A{.x = 1}; auto b = B{.x = a.x}; } gcc currently

[Bug c++/106354] New: Diagnostic could be more user friendly

2022-07-19 Thread barry.revzin at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider: template constexpr bool some_check() { return true; } struct C { }; static_assert(some_check::value); This is (obviously) wrong: some_check is a function

[Bug c++/106176] New: Compiler diagnostic doesn't show where it's coming from in my code

2022-07-03 Thread barry.revzin at gmail dot com via Gcc-bugs
ty: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider the following program, carefully reduced from real code: #include // template using which = std::map; templ

[Bug c++/106151] Inconsistent optimization when defaulting aggregate vs non-aggregate

2022-06-30 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106151 --- Comment #2 from Barry Revzin --- I guess that's like: C++11/14: neither is an aggregate (base class). C++17: both are aggregates. C++20: Bar is an aggregate, but Foo is not (user-declared constructor). But that really shouldn't affect the

[Bug c++/106151] New: Inconsistent optimization when defaulting aggregate vs non-aggregate

2022-06-30 Thread barry.revzin at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider this example: using size_t = decltype(sizeof(0)); struct string_view { // string_view() : ptr(nullptr), len(0

[Bug c++/105903] New: Missed optimization for __synth3way

2022-06-08 Thread barry.revzin at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider this example: #include #include inline constexpr auto synth3way = std::__detail::__synth3way; struct Iterator { std::vector::iterator it; constexpr bool

[Bug c++/105840] confusing diagnostic when naming the wrong class in a constructor

2022-06-03 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105840 --- Comment #2 from Barry Revzin --- I think something to this effect maybe? :9:7: error: attempting to declare constructor for unrelated class 'A'; did you mean to use 'B'? 9 | A(int i); | ^~ | B

[Bug c++/105840] New: confusing diagnostic when naming the wrong class in a constructor

2022-06-03 Thread barry.revzin at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- In this code: template struct X { }; struct A { A(int i); A(X x); }; struct B { A(int i); A(X x); }; I was

[Bug c++/53281] poor error message for calling a non-const method from a const object

2022-05-24 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53281 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com

[Bug c++/105672] Print note when unable to convert between types with the same name but different scopes

2022-05-20 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105672 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com

[Bug c++/102774] Stop showing "error: variable or field ‘f’ declared void" after an earlier error in a declarator

2022-05-18 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102774 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com

[Bug c++/105268] New: type/value mismatch when using variadic concept

2022-04-13 Thread barry.revzin at gmail dot com via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- >From StackOverflow (https://stackoverflow.com/q/71864544/2069064): template concept C_one = true; template concept C_many = true; template struct S { }; templ

[Bug c++/105195] New: spurious warning label defined but not used with if constexpr

2022-04-07 Thread barry.revzin at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Similar to other "if constexpr" related warnings, gcc warns on this example: void g(); void h(); template void f(

[Bug other/92396] -ftime-trace support

2022-03-29 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92396 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com

[Bug c++/105059] New: Inconsistency between paren- and brace-initialization of a union with anonymous struct

2022-03-25 Thread barry.revzin at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- union U { struct { int x; int y; }; long all; }; constexpr long parens() { U

[Bug c++/95153] Arrays of 'const void *' should not be copyable in C++20

2022-03-11 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95153 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com

[Bug libstdc++/104858] New: ranges::minmax double dereferences first

2022-03-09 Thread barry.revzin at gmail dot com via Gcc-bugs
: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- In https://github.com/gcc-mirror/gcc/blob/bded0d549fdfdc1328b2c0189dc5f8593b4cbe42/libstdc%2B%2B-v3/include/bits/ranges_algo.h#L3087: the initial result is constructed as

[Bug c++/88061] section attributes of variable templates are ignored

2022-03-08 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88061 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com

[Bug c++/104803] if consteval error from branch that isn't evaluated anyway

2022-03-07 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104803 --- Comment #6 from Barry Revzin --- Ugh, sorry. You guys are right. gcc is correct to reject the example. Bad bug report.

[Bug c++/104803] if consteval error from branch that isn't evaluated anyway

2022-03-05 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104803 --- Comment #4 from Barry Revzin --- For instance, clang accepts this version: consteval int p(int i) { return i > 2; } constexpr auto none_of(int const* f, int const* l) -> bool { for (; f != l; ++f) { int i = *f; if c

[Bug c++/104803] if consteval error from branch that isn't evaluated anyway

2022-03-05 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104803 --- Comment #3 from Barry Revzin --- clang is also wrong. p(i) doesn't have to be a constant expression there. The rule (http://eel.is/c++draft/expr.const#13) is "An immediate invocation shall be a constant expression." but an expression is only

[Bug c++/104803] New: if consteval error from branch that isn't evaluated anyway

2022-03-05 Thread barry.revzin at gmail dot com via Gcc-bugs
ormal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider this example. Yes, the body of none_of here looks... extremely bizarre. Just bear with me. template constexpr auto none_of(

[Bug c++/71283] Inconsistent location for C++ warning options in the manual

2022-03-04 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71283 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com

[Bug libstdc++/68350] std::uninitialized_copy overly restrictive for trivially_copyable types

2022-02-23 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68350 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com

[Bug libstdc++/103919] New: The basic_string(const T&, size_type, size_type) constructor is overconstrained

2022-01-05 Thread barry.revzin at gmail dot com via Gcc-bugs
RMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- >From StackOverflow (https://stackoverflow.com/q/70591571/2069064), with a clear description of the

[Bug c++/103783] New: Ambiguous overload between constrained static member and unconstrained non-static member

2021-12-20 Thread barry.revzin at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- >From StackOverflow (https://stackoverflow.com/q/70429541/2069064): template struct s { void f() co

[Bug c++/103712] New: variable is not a constant expression because it is used in its own initializer

2021-12-14 Thread barry.revzin at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Reduced from StackOverflow (https://stackoverflow.com/q/70342678/2069064): struct selfref { selfref* next

[Bug c++/103663] New: Diagnostic is missing multiple instantiation frames to help point to where the problem happens

2021-12-11 Thread barry.revzin at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- I'm sorry for how not-remotely-reduced these examples are, but I'm not sure how to

[Bug libstdc++/100795] ranges::sample should not use std::sample directly

2021-11-23 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100795 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com

[Bug libstdc++/101263] non-propagating-cache::emplace-deref missing constexpr

2021-10-14 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101263 --- Comment #6 from Barry Revzin --- The "real" answer is allowing constexpr placement new, but that obviously doesn't help you right now. But I think the helpful answer is that you can add a constructor to your storage like storage(init_from_i

[Bug tree-optimization/95384] Poor codegen cause by using base class instead of member for Optional construction

2021-10-12 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95384 --- Comment #4 from Barry Revzin --- Here's another example of the same kind of issue (https://godbolt.org/z/KWr9rMssj): template struct tagged_union { tagged_union(T t) : index(0), a(t) { } tagged_union(U u) : index(1), b(u) { }

[Bug c++/102644] New: deduction failure when having default non-type template parameters that are lambdas

2021-10-07 Thread barry.revzin at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- gcc trunk with -std=c++20 rejects this example as having no matching function call: template struct s

[Bug c++/102529] New: ctad for aliases fails in the presence of constraints

2021-09-29 Thread barry.revzin at gmail dot com via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Here's an example: template struct C { template C(U); }; template C(U) -> C; template requires true using A = C; C ok(1); // ok, a

[Bug c++/102289] New: Concept declaration with multiple template-heads not diagnosed

2021-09-11 Thread barry.revzin at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- gcc trunk accepts this: template template concept C = true; I'm not sure exactly what gcc does with it, but C does become a

[Bug c++/102263] New: Requesting enhanced warning on returning pointer/reference to local

2021-09-09 Thread barry.revzin at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- gcc (and clang) both warn on both of these functions: int* a() { int i = 0; return &i; } int& b() { i

[Bug c++/102236] New: emplace_deref is not constexpr for join_view

2021-09-07 Thread barry.revzin at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- For instance: #include constexpr std::string_view first_n_words(std::string_view str, size_t n) { namespace rv = std::views; auto first_n = str

[Bug libstdc++/101965] New: check in charconv is vacuously true

2021-08-18 Thread barry.revzin at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- When investigating PVS-Studio in our codebase, it flagged this check in charconv: 322template 323 __detail::__integer_to_chars_result_type<_Tp>

[Bug c++/101883] New: class template argument deduction in non-type template parameter allows explicit deduction guide

2021-08-12 Thread barry.revzin at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Reduced example: template struct C { constexpr C(int) {} }; explicit C(int) -> C; template str

[Bug c++/80943] Conversion function selected in list-initialization in C++1z mode

2021-08-09 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80943 --- Comment #3 from Barry Revzin --- This is CWG 2327 (http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#2327). It's still active, but gcc/clang's behavior (printing 2) seems like the superior choice.

[Bug c++/101006] New: Request diagnostic for likely concept syntax errors

2021-06-09 Thread barry.revzin at gmail dot com via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider the following: template concept Thing = true; template concept MemberThing = requires (T t) { t.member() -> Thing;// #1 !requi

[Bug c++/100835] New: defaulted equality gives wrong answer, if constexpr

2021-05-30 Thread barry.revzin at gmail dot com via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Short example: struct B { int i; CONSTEXPR bool operator==(B const&) const = default; }; struct D : B { CONSTEXPR bool operator==(D const&

[Bug c++/100639] New: reverse_view::reference erroneously uses iterator_traits::reference instead of iter_reference_t

2021-05-17 Thread barry.revzin at gmail dot com via Gcc-bugs
Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Short example (from https://stackoverflow.com/q/67573305/2069064): #include

[Bug c++/100322] Switching from std=c++17 to std=c++20 causes performance regression in relationals

2021-04-28 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100322 --- Comment #5 from Barry Revzin --- Sorry meant to actually copy the reduction: #include bool compare_count(int a, int b) { return a > b; } bool compare(int a, int b) { return (a <=> b) > 0; } which generates: compare_count(int,

[Bug c++/100322] Switching from std=c++17 to std=c++20 causes performance regression in relationals

2021-04-28 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100322 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com

[Bug c++/100084] using enum lookup isn't type-only

2021-04-14 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100084 --- Comment #1 from Barry Revzin --- Also gcc accepts: namespace A { enum A {}; }; using namespace A; using enum A::A; Which, apparently, this one should actually be ambiguous.

[Bug c++/100084] New: using enum lookup isn't type-only

2021-04-14 Thread barry.revzin at gmail dot com via Gcc-bugs
nt: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- >From Stack Avarflaw (https://stackoverflow.com/q/67096550/2069064): namespace A { enum A {}; }; using namespace A; using enum A; gcc trunk rejects this lookup as ambiguous,

[Bug c++/100070] New: Standard library container iterator-pair constructors should check C++20 iterator concepts

2021-04-13 Thread barry.revzin at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- >From StackOverflow (https://stackoverflow.com/q/67081354/2069064), a user was benchmarking code that

[Bug c++/100054] [11 Regression] internal compiler error: in get_nsdmi

2021-04-12 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100054 --- Comment #2 from Barry Revzin --- In case it helps, here's a different example which on trunk ICEs in get_nsdmi, but on gcc 10.2 and 10.3 ICEs on "unexpected expression '(F)()' of kind implicit_conv_expr" (and is accepted by 10.1) struct F {

[Bug c++/100054] New: internal compiler error: in get_nsdmi

2021-04-12 Thread barry.revzin at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Reduced with creduce and then by hand: template struct C { void find() { struct H { C c{}; }; (void)[](auto){ return H{}; }; } }; void f() { C().find

[Bug c++/100037] New: lookup doesn't find class template parameter in default member initializer of forward declared nested class template

2021-04-11 Thread barry.revzin at gmail dot com via Gcc-bugs
: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Issue title is a mouthful, but it's a very n

  1   2   3   >