[Bug c++/65994] New: auto deduces object instead of initializer_list

2015-05-03 Thread barry.revzin at gmail dot com
: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- From StackOverflow question: http://stackoverflow.com/q/30007692/2069064 Consider the following: struct Foo{}; int main() { Foo a; auto b{a}; a = b

[Bug c++/66108] New: cv-qualification deducation failure on conversion operator

2015-05-11 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 code (taken from SO question) #include iostream struct A { template class T operator T***() { static_assert

[Bug c++/66108] cv-qualification deducation failure on conversion operator

2015-05-11 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66108 --- Comment #1 from Barry Revzin barry.revzin at gmail dot com --- Forgot to add link: http://stackoverflow.com/questions/30172533/template-argument-type-deduction-by-conversion-operator

[Bug c++/66135] New: trailing return type generic lambda

2015-05-13 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 attempt at implementing fmap for optionals in C++: #include boost/optional.hpp #include iostream template typename Func auto fmap(Func f) { return [=](auto arg

[Bug c++/66344] New: non-static data member initializer in class template fails to compile

2015-05-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: --- The following code fails to compile on gcc 5.1: #include map template typename T struct X { std::mapint, T* storage = new

[Bug c++/67248] New: Variable template cannot be used as dependent name

2015-08-17 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: struct Value { templateclass T static constexpr T value = 0; }; templatetypename TValue struct Something { void foo

[Bug c++/67342] New: Ill-formed move constructor ignored in favor of copy constructor

2015-08-24 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: --- In the following code, A is neither movable nor copyable, and B has an A: #include utility struct A { A() { } A(A const

[Bug c++/67228] New: Template partial ordering failure ambiguous overload

2015-08-15 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: --- In the following code: #include tuple templateint I struct A {}; templateint I, typename... T void f(AI, std::tupleT *...) {} // (1) templatetypename... T void f

[Bug c++/66914] New: incorrect template partial ordering prefers non-member function instead of being ambiguous

2015-07-17 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: --- The following code: #include iostream template typename N struct A { template typename T void

[Bug c++/66893] New: disallowed initialization of reference with user-defined conversion function

2015-07-15 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 the following: struct B {}; struct S { explicit operator B(); }; int main() { B const t(S{}); } According

[Bug c++/67342] Ill-formed move constructor ignored in favor of copy constructor

2015-08-24 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67342 --- Comment #3 from Barry Revzin barry.revzin at gmail dot com --- Thanks! I was pretty sure I was wrong but couldn't figure out why. Barry On Mon, Aug 24, 2015, 2:29 PM redi at gcc dot gnu.org gcc-bugzi...@gcc.gnu.org wrote: https

[Bug c++/67943] Friend declaration applied to base class, leading to allowing access to protected base

2015-10-12 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67943 --- Comment #1 from Barry Revzin --- Actually, according to [class.base.access], this is valid code. Unless CWG 472 gets adopted I guess. In any case, disregard - my bad.

[Bug c++/67943] New: Friend declaration applied to base class, leading to allowing access to protected base

2015-10-12 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: --- gcc 5.2 compiles the following: struct Base { }; struct Derived : protected Base { }; struct Derived2 : public

[Bug c++/58740] incorrect access check of static base class member in derived template class

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

[Bug c++/66836] New: inconsistent unqualified lookup for friend declaration

2015-07-10 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: --- Consider the following code, courtesy of Belloc (http://stackoverflow.com/q/31348475/2069064): struct Outer { void f() { } class C { }; class Inner

[Bug c++/67426] New: Ambiguous overload between different function templates, where one has non-deduced arg

2015-09-01 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 this example (also in SO question http://stackoverflow.com/q/32335523/2069064): #include template

[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++/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++/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
: 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++/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++/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++/76262] New: list-initialization prefers initializer_list over copy constructor

2016-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: --- In this example: #include struct X { X(std::initializer_list) { std::cout << '1'; } X(X const& ) { std::

[Bug c++/72842] New: non-type template-parameter of type void

2016-08-08 Thread barry.revzin at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- The following compiles on gcc (and clang), across all versions I've tried: template void foo() { } int main() { foo(); } But void isn't a valid non-type template

[Bug c++/72842] non-type template-parameter of type void

2016-08-08 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72842 --- Comment #2 from Barry Revzin --- This non-dependent version: template void bar() { } fails to compile, even if we never call bar(), even if we wanted to call it with an empty pack. foo in the original example is this same thing with an

[Bug c++/72842] non-type template-parameter of type void

2016-08-08 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72842 --- Comment #4 from Barry Revzin --- I'll just email. Instantiating foo creates a function template with a non-type template parameter of type void. That's not an allowed type of a non-type template parameter, so I think it should be ill-formed.

[Bug c++/79378] New: lambda init-capture adds const

2017-02-04 Thread barry.revzin at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Minimal example: template struct is_same { static constexpr bool value = false; }; template struct is_same<T, T> { static constexpr bool value = true; }; int main() { int

[Bug c++/79138] New: ICE when trying to do template auto

2017-01-18 Thread barry.revzin at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- The following example: #include #include #include template struct value { }; template struct value_sequence { }; template constexpr value_sequence<As..., Bs...> op

[Bug c++/77825] New: return type deduction regression in 7.0

2016-10-03 Thread barry.revzin at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Can't come up with a more reduced example, but consider this code that makes a Y combinator version of factorial and calls it: #include #include template struct y_combinator

[Bug c++/78291] New: overload resolution prefers non-member operator to member operator when should be ambiguous

2016-11-10 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: struct A { template void operator==(T const& ) const; template fr

[Bug c++/78457] New: attempt to instantiate unused template

2016-11-21 Thread barry.revzin at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- The following fails to compile on any version of gcc (or clang) I tried: #include template struct X; template struct X { }; template struct Y { X x; }; template std

[Bug c++/78180] New: Poor optimization of std::array on gcc 4.8/5.4/6.2 as compared to simple raw array

2016-11-01 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 is a complete benchmark comparing a bunch of simple operations on a std::array<int64_t, 128> vs a int64

[Bug libstdc++/78134] New: set::set lower_bound() for transparent comparator returns const_iterator

2016-10-27 Thread barry.revzin at gmail dot com
: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- #include struct comp { bool operator()(int i, int j) const { return i < j; } using is_transpar

[Bug tree-optimization/78180] Poor optimization of std::array on gcc 4.8/5.4/6.2 as compared to simple raw array

2016-11-03 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78180 --- Comment #8 from Barry Revzin --- -D_GLIBCXX_USE_CXX11_ABI=0 doesn't matter. It's just that I'd compiled google benchmark with 4.8, and then wanted to test this behavior with 5.4 and 6.2. It has no impact on the generated assembly as far as I

[Bug c++/78180] Poor optimization of std::array on gcc 4.8/5.4/6.2 as compared to simple raw array

2016-11-01 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78180 --- Comment #1 from Barry Revzin --- Upon further investigation, all of the difference is in benchmark comes from the initialization of the raw array versus std::array. For some reason, in the two examples, the two containers are initialized

[Bug c++/77987] New: unique_ptr<T[]> reset rejects cv-compatible pointers

2016-10-14 Thread barry.revzin at gmail dot com
ty: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- #include int main() { std::unique_ptr p; p.reset(new char[1]); } fails to compile with due to reset invoking swap on two different types. H

[Bug c++/78753] New: non-ambiguous overload resolution with function template partial ordering rules

2016-12-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: --- In this example: template struct pack { }; // (1) template void foo(pack ) { } // (2) template void foo(pack&l

[Bug c++/78623] New: non-dependent name treated as if it were dependent, requiring use of template keyword

2016-11-30 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 on the marked line - gcc requires me to write result.template foo(), which

[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

[Bug c++/80703] New: Including breaks structured bindings

2017-05-10 Thread barry.revzin at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- >From this StackOverflow question: http://stackoverflow.com/q/43894619/2069064 This example fails: #include struct Point { int x, y; }; int main() { const auto [x

[Bug c++/80804] New: Default constructor improperly invoked in C++1z mode

2017-05-17 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: --- >From StackOverflow (http://stackoverflow.com/q/44015848/2069064), this code: #include #include struct S { S() { std::printf("DEF "); } /

[Bug c++/80767] New: Eager instantiation of member template when not required

2017-05-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: --- Here's a simplifed example of overloading taking from StackOverflow question http://stackoverflow.com/q/43982799/2069064: template struct

[Bug c++/81176] New: decltype(auto) yields reference type for structured binding

2017-06-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: --- >From StackOverflow (https://stackoverflow.com/q/44698195/2069064), this static assert trips: #include #include int main() { a

[Bug c++/80871] New: Template partial ordering considered non-ambiguous with deduced and non-deduced parameter packs

2017-05-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: --- Consider this example: #ifdef VARIADIC template constexpr int foo(Us... ) { return 1

[Bug c++/80961] New: Constructor preferred over conversion operator, when should be ambiguous

2017-06-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: --- In the following example: struct S; struct T { #ifdef BUG T(S const& ); #else T(S& ); #endif }; struct S {

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

2017-06-01 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80943 --- Comment #1 from Barry Revzin --- Sorry, it's a bug, but not for the reasons I cited. Both T t(s) and T t{s} should consider constructors - which should find T(S const& ) and T(T&& ) by way of the conversion function. But the former is an

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

2017-06-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: --- Consider this example: #include struct S; struct T { T() = default; T(S const& ) { std::cout << "1\n&q

[Bug c++/82266] New: [DR150] Allowing more specialized argument than parameter for placeholder

2017-09-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: --- This example compiles: template class P> struct X { }; template <auto*> struct A { }; int main() { X(); }

[Bug c++/82468] New: ICE with deduction guide template

2017-10-07 Thread barry.revzin at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- If we try to make the template-name of the deduction guide a type-parameter, courtesy of W.F. on SO (https://stackoverflow.com/q/46624005/2069064): template struct Foo { Foo(T

[Bug c++/71205] c++14 wrong constructor resolution

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

[Bug c++/82110] New: Concept for default constructing works with new T, not with new T[1]

2017-09-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: --- This example fails with all versions of gcc currently: struct X { X() = delete; }; template concept bool C

[Bug c++/81952] New: copy elision used when constructor needs to be called

2017-08-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: --- >From StackOverflow (https://stackoverflow.com/q/45843428/2069064), a reduced example: #include template struct opt { opt() { } opt(opt const&

[Bug c++/81975] New: Unpacking two packs via alias erroneously complains about mismatched argument packs

2017-08-24 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 slightly reduced from http://lists.isocpp.org/core/2017/08/2827.php: template struct is_same; struct

[Bug c++/82075] New: structured binding fails with empty base class

2017-09-01 Thread barry.revzin at gmail dot com
++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- struct B { }; struct D : B { int i; }; int main() { auto [i] = D{}; } On gcc 7.2, this fails with: sb.cxx:5:10: error: cannot decompose class type ‘D’: both

[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++/82980] New: Regression in determination of current instantiation (invalid requirement of template keyword)

2017-11-13 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 this example (reduced from SO: https://stackoverflow.com/q/47261553/2069064) template struct

[Bug c++/82893] New: Bad diagnostic on negative sized array

2017-11-07 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 example: struct Foo { int n; }; struct Bar { double n; bool b; }; template struct Baz : public T { char pad[8 - sizeof(T)]; }; int main

[Bug c++/83258] New: Rejecting function pointer non-type template parameter without linkage

2017-12-02 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: --- Example from StackOverflow (https://stackoverflow.com/q/47606810/2069064): template<void(*)()> struct A{}; in

[Bug c++/80985] -Wnoexcept-type should not produce a warning for inlined template functions

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

[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++/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++/82632] copy deduction candidate erroneously preferred over deduction-guide

2017-10-20 Thread barry.revzin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82632 --- Comment #1 from Barry Revzin --- Actually, I'm pretty sure that gcc is correct here while this is a clang bug for rejecting. The copy deduction candidate is more specialized, which is preferred first over the deduction-guide.

[Bug c++/82632] New: copy deduction candidate erroneously preferred over deduction-guide

2017-10-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: --- Minimal example courtesy of STL from https://bugs.llvm.org/show_bug.cgi?id=34970: template struct IsSame { static constexpr

[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{}, ); } fails with a different

[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++/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++/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 { }; template cl

[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++/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++/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 = ; #endif

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

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

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