[Bug c++/94252] New: Can't use a lambda in a requires expression

2020-03-21 Thread barry.revzin at gmail dot com
nt: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- This program: auto f = []{ return 0; }; static_assert(requires { f(); }); Fails to compile on trunk (https://godbolt.org/z/DEuoVM), with the error: :2:15:

[Bug libstdc++/90415] [9/10 Regression] std::is_copy_constructible> is incomplete

2020-03-26 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90415 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com

[Bug c++/95085] New: diagnostic on designated-initializer from braced-init-list could be better

2020-05-12 Thread barry.revzin at gmail dot com
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- In this program (note the typo in the call to f): struct A { int width, height; }; void f(A); void g() { f(A{.width

[Bug c++/95262] New: Taking address of function pointer do full concept overload resolution

2020-05-21 Thread barry.revzin at gmail dot com
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/61941173/2069064): template int f() { return 0; } template requires

[Bug c++/95383] New: Poor codegen when constructing a trivial Optional

2020-05-28 Thread barry.revzin at gmail dot com
: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Here is a complete example: struct nullopt_t {} inline constexpr nullopt{}; template struct Optional { struct Empty { }; union { Empty _; T

[Bug c++/95384] New: Poor codegen cause by using base class instead of member for Optional construction

2020-05-28 Thread barry.revzin at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Following up on #95383: struct nullopt_t {} inline constexpr nullopt{}; template struct OptionalStorage

[Bug c++/95384] Poor codegen cause by using base class instead of member for Optional construction

2020-05-28 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95384 --- Comment #1 from Barry Revzin --- Here's a simpler example: https://godbolt.org/z/FD7uEQ If the engaged member is an int instead of a bool (to remove the tail padding), gcc generates better code. This follows up on "PR 95383"

[Bug c++/95567] New: Defaulted virtual <=> has the wrong behavior

2020-06-07 Thread barry.revzin at gmail dot com
ent: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Reduced from Twitter user @feder_and_ink: #include struct B { B(int i) : i(i) {} VIRTUAL std::strong_ordering operator<=>(B const& other) const =

[Bug c++/95567] Defaulted virtual <=> has the wrong behavior

2020-06-09 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95567 --- Comment #1 from Barry Revzin --- To follow up on this, it's not the operator<=> being virtual that's significant but rather the class itself being polymorphic. This exhibits the same behavior: #include struct B { B(int i) : i(i) {} VIR

[Bug c++/95944] New: Concept diagnostic has multiple copies of irrelevant type and displays correct type incorrectly

2020-06-27 Thread barry.revzin at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider the following heavily reduced, and incorrect, attempt at an iterator: #include template

[Bug c++/96095] New: decltype((r)) inside of lambda with copy capture gives wrong type

2020-07-07 Thread barry.revzin at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Couldn't find a dupe for this one. The example from what is now [expr.prim.id.unqual]/2 (http://eel.is/c++draft/expr.prim.id.unq

[Bug c++/96142] New: is_constant_evaluated() returns false for variable with constant initialization

2020-07-09 Thread barry.revzin at gmail dot com
: 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/62822725/2069064), this program: #include int main() { int

[Bug c++/96142] is_constant_evaluated() returns false for variable with constant initialization

2020-07-09 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96142 Barry Revzin changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/96169] New: Don't provide internal lambda names in diagnostics?

2020-07-11 Thread barry.revzin at gmail dot com
y: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider the erroneous program: #include #include template F> void call_with_ints(F); void foo() { call_with_ints([](std::string const& s){

[Bug c++/96333] Regression on concepts constraint checking

2020-07-27 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96333 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com

[Bug c++/96411] New: erroneous "trait used in its own initializer" error when using concepts in a requirement

2020-08-01 Thread barry.revzin at gmail dot com
NCONFIRMED 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/63202619/2069064): template constexpr

[Bug c++/96497] Compare std::variant with int using C++20 <=> is not a constant expression

2020-08-06 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96497 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com

[Bug c++/96557] New: Diagnostics: Can you tell me why it's not a constant expression?

2020-08-10 Thread barry.revzin at gmail dot com
ormal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider: struct X { char storage[100] = {}; char const* head = storage; }; void f() { constexpr X x = {}; }

[Bug c++/96602] New: Partial ordering is ambiguous with default function arguments

2020-08-13 Thread barry.revzin at gmail dot com
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/63390165/2069064): template constexpr int foo(int=0){ return 0; } template

[Bug c++/53610] C++11: constructors accept silly initializers

2019-10-24 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53610 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com

[Bug c++/92776] New: Can't define member function out of line with non-type template parameter

2019-12-03 Thread barry.revzin at gmail dot com
erity: 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/59163716/2069064): struct A {}; template struct B { v

[Bug c++/92974] New: diagnostic missing source information

2019-12-17 Thread barry.revzin at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Here's the best reduction I was able to come up with thanks to creduce: # 1 "" 3 typedef unsigned char a; typedef unsigned b; enum { c }; class d { public: te

[Bug c++/92985] New: missed optimization opportunity for switch linear transformation

2019-12-18 Thread barry.revzin at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- From Peter Dimov on Slack: #include struct X { int x, y, z; int operator[]( std::size_t i ) const noexcept

[Bug c++/93016] New: erroneous new (nothrow_t) still throws an exception

2019-12-19 Thread barry.revzin at gmail dot com
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Reduced from SO (https://stackoverflow.com/q/59414654/2069064): #include int f() { int n = -1; try { int *p = new(std::nothrow) int[n]; if

[Bug c++/93083] New: copy deduction rejected when doing CTAD for NTTP

2019-12-27 Thread barry.revzin at gmail dot com
: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Reduced a bit from Jonathan Müller's example on Slack: using size_t = decltype(sizeof(0)); template struct string_literal { constexpr string_literal(const

[Bug c++/93107] unable to deduce initializer_list from function template

2019-12-30 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93107 --- Comment #1 from Barry Revzin --- Meant to add the StackOverflow link: https://stackoverflow.com/q/59517774/2069064

[Bug c++/93107] New: unable to deduce initializer_list from function template

2019-12-30 Thread barry.revzin at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Reduced from StackOverflow: #include template void Task() {} auto a = &Task; auto b = { &Task }; std::initializer_list c = { &

[Bug libstdc++/93479] New: compare_three_way allows comparing arrays

2020-01-28 Thread barry.revzin at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- This program: #include bool check(int(&x)[4], int(&y)[4]) { return std::compare_three_way{}(x, y) == 0; } Successfully compiles, with check() doing an

[Bug c++/93480] New: Defaulted <=> doesn't expand array elements

2020-01-28 Thread barry.revzin at gmail dot com
omponent: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- This example should be valid: #include struct C { int x[4]; auto operator<=>(C const&) const = default; }; bool check(C const& a, C const&

[Bug c++/91847] init-capture pack of references requires ... on wrong side

2020-02-15 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91847 --- Comment #2 from Barry Revzin --- In the Prague meeting, this paper (https://brevzin.github.io/cpp_proposals/2095_lambda_pack_cwg/p2095r0.html) was adopted into what will become the C++20 standard, which moves the & in the grammar to the left

[Bug c++/93929] New: In copy elision cases, fallback to lvalue even if rvalue overload resolution succeeds

2020-02-25 Thread barry.revzin at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Example: struct X { X(); X(X const&); X(X&&) = delete; }; X make() { X a; retur

[Bug c++/93940] New: crazy codegen bug on Og with builtin_constant_p, coverage, and pthread

2020-02-25 Thread barry.revzin at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- This holds for gcc 8.x, 9.x, and trunk. The following program (thanks, creduce): using uint16_t = unsigned short; struct a

[Bug c++/93940] crazy codegen bug on Og with builtin_constant_p, coverage, and pthread

2020-02-25 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93940 --- Comment #1 from Barry Revzin --- gcc 7.x has the same behavior. gcc 6.x work fine.

[Bug middle-end/93940] crazy codegen bug on Og with builtin_constant_p, coverage, and pthread

2020-02-25 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93940 --- Comment #2 from Barry Revzin --- Slightly more reduced: https://godbolt.org/z/5R9A5g

[Bug libstdc++/93983] std::filesystem::path is not concept-friendly

2020-02-29 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93983 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com

[Bug libstdc++/93983] std::filesystem::path is not concept-friendly

2020-02-29 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93983 --- Comment #2 from Barry Revzin --- (From Tim) This is LWG 3244.

[Bug c++/56428] [C++11] "is not a constant expression" when comparing non-type template argument to nullptr

2019-01-07 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56428 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com

[Bug c++/88864] New: default template arguments not merged across all declarations

2019-01-15 Thread barry.revzin at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Shorter repro from StackOverflow https://stackoverflow.com/q/54202462/2069064: struct B { template B(T t); }; template B::B(T t

[Bug c++/88998] New: bad codegen with mmx instructions for unordered_map

2019-01-22 Thread barry.revzin at gmail dot com
: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- This program should be valid: #include #include #include [[gnu::noinline]] double prepare(int a, int b) { __m128i is = _mm_setr_epi32(a, b, 0, 0); __m128d

[Bug c++/89048] New: constant evaluation in trailing return type rejected

2019-01-24 Thread barry.revzin at gmail dot com
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- This program is rejected by gcc: template struct X { }; template constexpr auto f(F f) -> X { return {}; } with: source>:3:53: error: template argumen

[Bug c++/89048] constant evaluation in trailing return type rejected

2019-01-24 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89048 --- Comment #1 from Barry Revzin --- Actually, now I'm really not sure if this is a gcc bug, but then I really don't know what the language rule is that rejects this. Sorry for the spam, this needs some more thought.

[Bug c++/89062] New: class template argument deduction failure with parentheses

2019-01-25 Thread barry.revzin at gmail dot com
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/54369677/2069064: template struct Foo { Foo(T) {} }; template struct Bar

[Bug c++/89062] class template argument deduction failure with parentheses

2019-01-25 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89062 --- Comment #2 from Barry Revzin --- This may or may not be the same bug as https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87709, I do not know.

[Bug libstdc++/89164] New: can construct vector with non-copyable-but-trivially-copyable elements

2019-02-02 Thread barry.revzin at gmail dot com
Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider (from https://stackoverflow.com/q/54498610/2069064): #include struct X { X() = default; X(const X&) = de

[Bug c++/89226] New: codegen for copying a 512-bit object fails to use avx instructions

2019-02-06 Thread barry.revzin at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider the following example: #include // DUMB PAIR struct dumb_pair { alignas(2*sizeof(__m256i)) __m256i x[2]; }; void

[Bug c++/85612] New: ADL lookup with parameter pack and defaulted argument not considered ambiguous

2018-05-02 Thread barry.revzin at gmail dot com
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Hopefully-minimal example: #ifdef WORKS template R foo(T&&...) { return 0; } #else template decltype(aut

[Bug c++/85883] New: class template argument deduction fails in new-expression

2018-05-22 Thread barry.revzin at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Slightly reduced from https://stackoverflow.com/q/50478019/2069064: template struct Bar { Bar(T1, T2) { } }; int main() { auto x

[Bug c++/86327] New: Spurious error on non-constant expression in constexpr function

2018-06-26 Thread barry.revzin at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Reduced example from https://stackoverflow.com/q/51053280/2069064: int global = 0; constexpr int f(bool arg) { if (arg

[Bug c++/91262] New: using template type parameter after typename

2019-07-25 Thread barry.revzin at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Reduced from StackOverflow (https://stackoverflow.com/q/57206006/2069064), this short example: struct Wrapper { template using type = T; }; template void foobar

[Bug c++/91304] New: maybe_unused attribute ignored on variable declared in if declaration

2019-07-30 Thread barry.revzin at gmail dot com
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/57281641/2069064): int f(); void g() { if ([[maybe_unused]] int i

[Bug c++/91319] New: Designated initializer doesn't support direct-initialization

2019-08-01 Thread barry.revzin at gmail dot com
ormal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- This currently fails to compile on trunk: struct X { explicit X() { } }; struct Aggr { X x; }; Aggr f() { return Ag

[Bug c++/91380] New: Requesting a better diagnostic for dumb include mistake

2019-08-06 Thread barry.revzin at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- We just had an example in our codebase which did the moral equivalent of: #include "" gcc's diagnostic for this is: :1:

[Bug c++/91380] Requesting a better diagnostic for dumb include mistake

2019-08-07 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91380 --- Comment #3 from Barry Revzin --- In case it's at all helpful, here's the clang review that Tim found for this diagnostic: https://reviews.llvm.org/D51333

[Bug c++/91428] New: Please warn on if constexpr (std::is_constant_evaluated())

2019-08-12 Thread barry.revzin at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- A very common user error with std::is_constant_evaluated is to write this: #include constexpr int foo(int i) { if constexpr (std

[Bug c++/91429] New: Conditional explicit not respected with out-of-line definition

2019-08-12 Thread barry.revzin at gmail dot com
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/57467490/2069064): using size_t = decltype(sizeof(0)); struct Str

[Bug c++/91483] New: Poor diagnostic on trying to take constexpr reference to non-static object

2019-08-18 Thread barry.revzin at gmail dot com
: 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 const& var; }; void foo() { constexpr int i = 42; constexpr X x{i}; } This is

[Bug c++/91548] New: Regression in constexpr evaluation of std::array

2019-08-26 Thread barry.revzin at gmail dot com
: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- The following compiles on gcc 9.2 -std=c+=2a but fails on gcc trunk. This example is based on the implementation of std::array: using size_t = decltype(sizeof(0

[Bug c++/91618] New: template-id required to friend a function template, even for a qualified-id

2019-08-30 Thread barry.revzin at gmail dot com
: 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/57730286/2069064): template void f(T); struct A { friend void

[Bug c++/91847] New: init-capture pack of references requires ... on wrong side

2019-09-20 Thread barry.revzin at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- gcc implements the letter of the standard and allows this: template void foo(T&... ts) { [...&us=ts]{}; } While that is valid

[Bug c++/91974] New: function not sequenced before function argument

2019-10-02 Thread barry.revzin at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- >From StackOverflow (https://stackoverflow.com/q/58204296/2069064), reduced: extern void call(int); void a(int) { call(0); } void b(int) { call(1); } int m

[Bug c++/91974] function not sequenced before function argument

2019-10-02 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91974 --- Comment #2 from Barry Revzin --- C++17 does change this rule. expr.call/8: The postfix-expression is sequenced before each expression in the expression-list and any default argument. The initialization of a parameter, including every associa

[Bug c++/91974] function not sequenced before function argument

2019-10-02 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91974 --- Comment #4 from Barry Revzin --- Yes, sorry if that wasn't clear, this is with -std=c++17.

[Bug c++/83447] New: parameter after function parameter pack gets improperly deduced

2017-12-17 Thread barry.revzin at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- This example compiles: template void foo(Args..., T ) { } int main() { foo(0); } with Args deducing as empty

[Bug c++/83542] New: template deduction failure when using pack in both deduced and non-deduced contexts

2017-12-21 Thread barry.revzin at gmail dot com
Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- This example fails to compile: template struct list { }; template void foo(list, list, void(*)(T..., U

[Bug c++/83542] template deduction failure when using pack in both deduced and non-deduced contexts

2017-12-21 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83542 --- Comment #1 from Barry Revzin --- This slightly different example: template struct list { }; template void foo(list, list, void(*)(T..., U)) { } void f(int, int) { } int main() { foo(list{}, list{}, &f); } fails with a different

[Bug c++/83614] New: deduction failure for template-template argument with trailing template parameter pack

2017-12-28 Thread barry.revzin at gmail dot com
Severity: normal 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: template struct X { }; template class A, typename T> struct Y { }; templat

[Bug c++/83806] New: Spurious unused-but-set-parameter with nullptr

2018-01-11 Thread barry.revzin at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- This program: template bool equals(X x, Y y) { return (x == y); } int main() { const char* p = nullptr; equals(p, nullptr); } When compiled as: $ g++ -std

[Bug c++/89568] New: constexpr functions are implicitly noexcept

2019-03-03 Thread barry.revzin at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Short repro: struct Y { }; bool operator<(Y a, Y b) { return false; } constexpr bool operator>(Y a, Y b) { return false; } static_assert(!noexcept(Y

[Bug c++/89686] New: Lambda pack capture with pack on both sides

2019-03-12 Thread barry.revzin at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Vittorio, the wizard of lambda+pack bugs, is at it again: https://stackoverflow.com/questions/55127906/lambda-pack-capture-with-ellipsis-on-both-sides-what-is-the-meaning

[Bug c++/89989] New: missed devirtualization opportunity on final function

2019-04-05 Thread barry.revzin at gmail dot com
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Example: struct Base { virtual int foo() { return 0; } int bar() { return foo(); } }; struct Derived : Base { int foo() override final { return 1

[Bug c++/61414] enum class bitfield size-checking needs a separate warning flag controlling it

2019-04-25 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61414 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com

[Bug c++/78010] --Wsuggest-override reports a redundant warning on a 'final' method

2019-05-06 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78010 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com

[Bug c++/90413] New: Bad diagnostic when trying to copy an uncopyable type

2019-05-09 Thread barry.revzin at gmail dot com
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Here's a short repro: template struct Bar { Bar() {} Bar(const Bar&) { static_assert(sizeof(T) == 1, ""); } }; template s

[Bug c++/90413] Bad diagnostic when trying to copy an uncopyable type

2019-05-09 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90413 --- Comment #1 from Barry Revzin --- clang also doesn't do this well: https://bugs.llvm.org/show_bug.cgi?id=41819

[Bug c++/78010] --Wsuggest-override reports a redundant warning on a 'final' method

2019-05-10 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78010 --- Comment #13 from Barry Revzin --- Thanks Marek!

[Bug c++/90475] New: Diagnostic for designated initializer could be a lot better

2019-05-14 Thread barry.revzin at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- gcc 8 and 9 have made dramatic improvements in diagnostics, but here's a case where it could be a lot better: the "oops, I

[Bug c++/90769] New: Template instantiation recursion when trying to do a conversion template

2019-06-05 Thread barry.revzin at gmail dot com
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Reduced slightly from https://stackoverflow.com/q/56470126/2069064: #include enum E {A, B}; template struct X { template

[Bug c++/90769] Template instantiation recursion when trying to do a conversion template

2019-06-05 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90769 --- Comment #1 from Barry Revzin --- Sorry, more reduced: #include enum E {A, B}; struct X { template = 0> constexpr X(int v); template = 0> operator OUT() const; }; #ifdef WORKS bool operator!=(X const& lhs, int) { return st

[Bug c++/90943] New: Visiting inherited variants no longer works in 9.1

2019-06-19 Thread barry.revzin at gmail dot com
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Here's a short repro: #include struct V : std::variant { using std::variant::variant; }; namespace std { template <> struct v

[Bug libstdc++/90943] Visiting inherited variants no longer works in 9.1

2019-06-19 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90943 --- Comment #2 from Barry Revzin --- What if we did something like (using pretty names for a sec): template struct _Extra_visit_slot_needed { template static bool_constant<__never_valueless<_Types...>()> __impl(const variant<_Types...>&)

[Bug libstdc++/91007] New: stable_sort segfaults on -O3

2019-06-26 Thread barry.revzin at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Reduced from StackOverflow (https://stackoverflow.com/q/56779605/2069064): #include #include int main() { using V = std::vector; std::vector conns{ V{0,2

[Bug c++/86439] New: CTAD with deleted copy constructor fails due to deduction-guide taking by value

2018-07-09 Thread barry.revzin at gmail dot com
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Reduced from: https://stackoverflow.com/q/51244047/2069064 struct NC { NC() = default; NC(NC const&) = de

[Bug c++/86703] New: template auto fails deduction, where template int succeeds

2018-07-27 Thread barry.revzin at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Reduced example from https://stackoverflow.com/q/51561232/2069064: struct false_type { static constexpr bool value = false

[Bug c++/86818] New: injected-class-name interpreted as type instead of constructor

2018-08-01 Thread barry.revzin at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- From https://stackoverflow.com/q/51621560/2069064: template using void_t = void; template struct X { static constexpr bool value

[Bug c++/86826] New: deduction fails on auto-returning function template

2018-08-01 Thread barry.revzin at gmail dot com
: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Reduced from: https://stackoverflow.com/q/51643222/2069064 template auto zero(T) { return 0; } template void deduce(F); void ex() { #ifdef VAR auto x = &

[Bug c++/87399] New: Inconsistent determination of what is usable in a constant expression with __PRETTY_FUNCTION__

2018-09-23 Thread barry.revzin at gmail dot com
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/52472000/2069064): template struct X

[Bug c++/84689] New: is_invocable is true even for call operator via ambiguous base

2018-03-03 Thread barry.revzin at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- This static assert fires on gcc, it does not on clang: #include struct base { void operator()(int ) { } }; struct a : base

[Bug c++/85149] New: False branch of if constexpr instantiated in generic lambda

2018-03-31 Thread barry.revzin at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- On latest trunk (8.0.1), the following compiles. But with -DBUG it doesn't: template struct is_void { static constexpr bool value =

[Bug c++/87530] New: copy elision in return statement doesn't check for rvalue reference to object type

2018-10-05 Thread barry.revzin at gmail dot com
IRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Example from StackOverflow (https://stackoverflow.com/q/52662407/2069064): struct Base { }; template str

[Bug libstdc++/87538] New: Incorrect noexcept specifier for not_fn

2018-10-05 Thread barry.revzin at gmail dot com
: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Found by Edgar Rokjān (https://stackoverflow.com/q/52673235/2069064). The noexcept specifier for _Not_fn currently only checks the noexcept-ness of applying the ! operator

[Bug c++/87712] New: class template argument deduction fails with wrapped parentheses

2018-10-23 Thread barry.revzin at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Reduced from https://stackoverflow.com/q/52950967/2069064: template struct lit { lit(T ); }; template void operator+(lit, int

[Bug c++/87712] class template argument deduction fails with wrapped parentheses

2018-10-23 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87712 --- Comment #3 from Barry Revzin --- Didn't realize the OP had filed a bug report already.

[Bug c++/70099] New: Function found by ADL, but shouldn't be visible at point of definition

2016-03-05 Thread barry.revzin at gmail dot com
erity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- The following fragment compiles on g++ 5.3.0: struct X { }; namespace foo { template void bar() { T{

[Bug c++/70142] New: Class members not in scope in exception-specification

2016-03-08 Thread barry.revzin at gmail dot com
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- The following code fails to compile, with an error about y not being in scope: struct X { X() noexcept(noexcept(y+1)) { } int y; }; int main() { } However

[Bug c++/70141] [6.0 regression] template parameter not deducible in partial specialization of template inside template

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

[Bug c++/41437] No access control for classes in template functions

2016-03-13 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41437 Barry Revzin changed: What|Removed |Added CC||barry.revzin at gmail dot com

[Bug c++/70375] New: catch by value still allows explicit constructor

2016-03-23 Thread barry.revzin at gmail dot com
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- gcc 5.3.0 compiles this code: struct B { B() = default; explicit B(B const& ) { } }; struct D : B { }; int main() { try { thr

[Bug c++/70971] New: ICE in parameter pack expansion

2016-05-05 Thread barry.revzin at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- This may not be totally minimal, but the following code: #include struct A {}; template struct B : A { }; template struct typelist {}; template struct tag { using type = T

[Bug c++/81486] New: Class template argument deduction fails with (), succeeds with {}

2017-07-19 Thread barry.revzin at gmail dot com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider this example, simplified from https://stackoverflow.com/q/45195890/2069064: template struct C { C(T ); }; template

[Bug c++/81789] New: CWG1687 performed too soon

2017-08-09 Thread barry.revzin at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Consider this reduced example taken from StackOverflow (https://stackoverflow.com/questions/45602368/correct-behavior-of-built-in-operator-candidates-of-the-overload-resolution-in-t): struct

  1   2   3   >