[Bug c++/77781] [DR 1315] Some valid cases of partial specialization not accepted

2017-12-15 Thread colu...@gmx-topmail.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77781

Robert Haberlach  changed:

   What|Removed |Added

 CC||colu...@gmx-topmail.de

--- Comment #2 from Robert Haberlach  ---
Clang now accepts the second example.

[Bug c++/84692] New: Class template argument deduction ICE for template's member template

2018-03-03 Thread colu...@gmx-topmail.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84692

Bug ID: 84692
   Summary: Class template argument deduction ICE for template's
member template
   Product: gcc
   Version: 8.0.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: colu...@gmx-topmail.de
  Target Milestone: ---

template 
struct X {
template 
struct Y {
Y(U, Ts const&... );
};

friend void begin(X) {
  Y{0, Ts{}...};
}
};

int main() {
  begin(X{});
}

---

prog.cc: In substitution of 'template iterator(Iter, const Ts&
...)-> incrementing_range::iterator [with Iter = 128]':
prog.cc:9:7:   required from 'void begin(incrementing_range)'
prog.cc:14:34:   required from here
prog.cc:9:7: internal compiler error: in tsubst, at cp/pt.c:13992
   iterator{0, Ts{}...};
   ^~~~

---

I can't reduce this any further. 

Oddly, Clang claims this is ill-formed, while I reckon this should compile,
although I haven't delved into the wording to see what it mandates regarding
template members. Perhaps iterator is treated as the qualified-id X::Y, and the
compilers attempt to deduce Ts, which fails?

[Bug c++/84692] Class template argument deduction ICE for template's member template

2018-03-03 Thread colu...@gmx-topmail.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84692

--- Comment #1 from Robert Haberlach  ---
Btw. begin being a friend is irrelevant, it can also be a non-static or static
member.

[Bug c++/84692] Class template argument deduction ICE for template's member template

2018-03-03 Thread colu...@gmx-topmail.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84692

--- Comment #2 from Robert Haberlach  ---
And furthermore, I forgot to paste the correct compiler output, as the above
was yielded before I shortened the names:

prog.cc: In substitution of 'template Y(U, const Ts& ...)-> X::Y [with U = 128]':
prog.cc:9:7:   required from 'void begin(X)'
prog.cc:14:17:   required from here
prog.cc:9:7: internal compiler error: in tsubst, at cp/pt.c:13992
   Y{0, Ts{}...};

[Bug c++/69531] New: Implement CWG 1307; Differently bounded array parameters

2016-01-28 Thread colu...@gmx-topmail.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69531

Bug ID: 69531
   Summary: Implement CWG 1307; Differently bounded array
parameters
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: colu...@gmx-topmail.de
  Target Milestone: ---

int main() {
  int f(int(&&)[1]);
  int f(int(&&)[2]);
  f({1});
}

The list initialization sequence specified by [over.ics.list]/5 for the first
overload is better as per [over.ics.rank]/(3.1.2).

[Bug c++/69623] New: CWG 1388; Invalid deduction of non-trailing template parameter pack

2016-02-02 Thread colu...@gmx-topmail.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69623

Bug ID: 69623
   Summary: CWG 1388; Invalid deduction of non-trailing template
parameter pack
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: colu...@gmx-topmail.de
  Target Milestone: ---

template 
void f(T..., U...) {}

int main() {f();}

---

This shouldn't compile. Although U is deduced to the empty pack via
[temp.arg.explicit]/3, T isn't, because it isn't trailing. I.e. this code
should yield a deduction failure.

Also see https://llvm.org/bugs/show_bug.cgi?id=26435.

[Bug libstdc++/80564] New: bind on SFINAE unfriendly generic lambda

2017-04-29 Thread colu...@gmx-topmail.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80564

Bug ID: 80564
   Summary: bind on SFINAE unfriendly generic lambda
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: colu...@gmx-topmail.de
  Target Milestone: ---

Related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49058

---
#include 

int main() {
int i;
std::bind([] (auto& x) {x = 1;}, i)();
}

---

This is rejected because, during overload resolution, _Bind::operator() const's
default template argument is spuriously instantiated.

[Bug libstdc++/80564] bind on SFINAE unfriendly generic lambda

2017-05-04 Thread colu...@gmx-topmail.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80564

--- Comment #6 from Robert Haberlach  ---
(In reply to TC from comment #4)
> (In reply to Eric Fiselier from comment #3)
> > Here is an example of why `_Bind::operator()(...) const` must be considered
> > during overload resolution even if the call wrapper itself is not const.
> > 
> > --
> > #include 
> > 
> > struct Func {
> >   template 
> >   void operator()(Args&&...) = delete;
> > 
> >   template 
> >   void operator()(Args&&...) const {}
> > };
> > 
> > int main() {
> > Func f;
> > std::bind(f)();
> > }
> > -
> 
> Interesting, libstdc++ rejects this as an attempt to call a deleted
> function. That seems more correct than libc++'s approach which calls the
> const overload.

See also the discussion on Phabricator: https://reviews.llvm.org/D32824

I agree. AFAICS [func.bind.bind] is clear on this: the type of the Func
object used to call the member operator() is non-const.

[Bug libstdc++/80564] bind on SFINAE unfriendly generic lambda

2017-05-04 Thread colu...@gmx-topmail.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80564

--- Comment #7 from Robert Haberlach  ---
Oh, damn. "Submit only my new comment" does not what I thought it does. :-)

[Bug c++/79520] New: Spurious caching for constexpr arguments

2017-02-14 Thread colu...@gmx-topmail.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79520

Bug ID: 79520
   Summary: Spurious caching for constexpr arguments
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: colu...@gmx-topmail.de
  Target Milestone: ---

constexpr int f(int const& x) {return x;}

constexpr struct S {
int x = 0;
constexpr S() {(void)f(x); x = 1;}
} s;

static_assert(f(s.x) == 1, "");

---

Presumably s.x is taken to be "immutable" because s is constexpr, while that's
obviously not true during the period of construction.

[Bug c++/78019] New: Local class with lambda in default member initializer cannot default-capture this

2016-10-18 Thread colu...@gmx-topmail.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78019

Bug ID: 78019
   Summary: Local class with lambda in default member initializer
cannot default-capture this
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: colu...@gmx-topmail.de
  Target Milestone: ---

int main() {
struct A {
int x, i = [&] { return x; }();
} a{0};
}

-
> error: 'this' was not captured for this lambda function 

Making the default-capture `=' doesn't help, but explicitly capturing `this'
works.

[Bug c++/11407] [DR 115] Function cannot be resolved

2016-10-19 Thread colu...@gmx-topmail.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11407

Robert Haberlach  changed:

   What|Removed |Added

 CC||colu...@gmx-topmail.de

--- Comment #18 from Robert Haberlach  ---
This is not fixed:

template void g();

int i = sizeof(&g);

fails with trunk.

[Bug c++/78223] New: struct containing default member initializer fails constexpr test in aggregate initialization

2016-11-06 Thread colu...@gmx-topmail.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78223

Bug ID: 78223
   Summary: struct containing default member initializer fails
constexpr test in aggregate initialization
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: colu...@gmx-topmail.de
  Target Milestone: ---

constexpr struct X {
X const& x = *this; 
} y {{}};



This is valid as of core issue 1454's resolution.

[Bug c++/66292] New: ICE in constexpr call evaluation

2015-05-26 Thread colu...@gmx-topmail.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66292

Bug ID: 66292
   Summary: ICE in constexpr call evaluation
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: minor
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: colu...@gmx-topmail.de
  Target Milestone: ---

When compiling Testing.cxx from
https://github.com/Arcoth/Constainer/blob/9a96ba3089778fe655fde2334701077e2d6c8f35/Testing.cxx#L91,
GCC bails out at the end:

/home/arcoth/Programming/Constainer/Testing.cxx:91:41:   in constexpr expansion
of »Constainer::strToInt(((const char*)" 6849."), 0u, 10)«
/home/arcoth/Programming/Constainer/Parser.hxx:156:22:   in constexpr expansion
of »Constainer::strToInt(str,
Constainer::CharTraits::length(str), pos, base)«
/home/arcoth/Programming/Constainer/Parser.hxx:143:25:   in constexpr expansion
of »Constainer::strToInt(str, (str + ((sizetype)len)), ret,
base)«
/home/arcoth/Programming/Constainer/Testing.cxx:91:55:   in constexpr expansion
of »Constainer::BasicString(((const
char*)"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"))«
/home/arcoth/Programming/Constainer/String.hxx:179:9:   in constexpr expansion
of »Constainer::BasicString::append >(str)«
/home/arcoth/Programming/Constainer/String.hxx:292:16:   in constexpr expansion
of »Constainer::BasicString::append >(str,
Constainer::CharTraits::length(str))«
/home/arcoth/Programming/Constainer/String.hxx:277:47:   in constexpr expansion
of »Constainer::BasicString::insert >(((Constainer::BasicString*)this)->Constainer::BasicString::.Constainer::detail::BasicVector::size, 1ul>(), str,
len)«
/home/arcoth/Programming/Constainer/String.hxx:235:3:   in constexpr expansion
of »((Constainer::BasicString*)this)->Constainer::BasicString::.Constainer::detail::BasicVector::_createInsertionSpace, 1ul>Constainer::Array::const_iterator)((Constainer::BasicString*)this)->Constainer::BasicString::.Constainer::detail::BasicVector, 1ul>::.Constainer::Array::begin()) + ((sizetype)index)), len)«
/home/arcoth/Programming/Constainer/Vector.hxx:83:9:   in constexpr expansion
of »Constainer::Assertconst value_type*)Constainer::detail::BasicVector::end, 1ul>()) >= pos), 0u)«
/home/arcoth/Programming/Constainer/Testing.cxx:91:55: interner
Compiler-Fehler: Speicherzugriffsfehler

static_assert( Constainer::strToInt(" 6849.") == 6849 );
   ^
0xc8bd7f crash_signal
../.././gcc/toplev.c:380
0x9f8444 bool vec_safe_reserve(vec*&, unsigned int, bool)
../.././gcc/vec.h:575
0x9f8444 tree_node** vec_safe_push(vec*&, tree_node* const&)
../.././gcc/vec.h:669
0x9f8444 add_local_decl(function*, tree_node*)
../.././gcc/function.c:6705
0xcfce86 remap_decls
../.././gcc/tree-inline.c:653
0xcfea30 remap_block
../.././gcc/tree-inline.c:721
0xcff7e8 copy_bind_expr
../.././gcc/tree-inline.c:794
0xcff7e8 copy_tree_body_r(tree_node**, int*, void*)
../.././gcc/tree-inline.c:1128
0xf0e5a2 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set*, tree_node*
(*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*,
hash_set*))
../.././gcc/tree.c:7
0xcf68ef copy_tree_body
../.././gcc/tree-inline.c:2964
0xcfd31e copy_fn(tree_node*, tree_node*&, tree_node*&)
../.././gcc/tree-inline.c:5994
0x7cedc6 cxx_eval_call_expression
../.././gcc/cp/constexpr.c:1347
0x7cfff4 cxx_eval_constant_expression
../.././gcc/cp/constexpr.c:3062
0x7d0c47 cxx_eval_conditional_expression
../.././gcc/cp/constexpr.c:1648
0x7d0c47 cxx_eval_constant_expression
../.././gcc/cp/constexpr.c:3353
0x7d0c47 cxx_eval_conditional_expression
../.././gcc/cp/constexpr.c:1648
0x7d0c47 cxx_eval_constant_expression
../.././gcc/cp/constexpr.c:3353
0x7d5855 cxx_eval_statement_list
../.././gcc/cp/constexpr.c:2853
0x7d0c07 cxx_eval_constant_expression
../.././gcc/cp/constexpr.c:3425
0x7cf0c3 cxx_eval_call_expression
../.././gcc/cp/constexpr.c:1377

I can currently not be asked to boil the example down, since it emerges from a
fairly large project. However, I can confirm this in trunk v. 20150502.

[Bug c++/66292] ICE in constexpr call evaluation

2015-05-26 Thread colu...@gmx-topmail.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66292

--- Comment #2 from Columbo  ---
(In reply to Marek Polacek from comment #1)
> Please provide a preprocessed source file (does not have to be reduced).

The file is larger than 1000kb. It consists of 88000 lines.


[Bug c++/66292] ICE in constexpr call evaluation

2015-05-26 Thread colu...@gmx-topmail.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66292

--- Comment #4 from Columbo  ---
Created attachment 35630
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35630&action=edit
Testcase for 66292


[Bug c++/67593] New: Partial specialization: "Template argument involves template parameters"

2015-09-15 Thread colu...@gmx-topmail.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67593

Bug ID: 67593
   Summary: Partial specialization: "Template argument involves
template parameters"
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: colu...@gmx-topmail.de
  Target Milestone: ---

template 
struct outer
{
template  struct inner {};
template  struct inner {};
};

This fails to compile, although the code is well-formed (in particular,
[temp.class.spec]/(8.1) and (8.2) are not violated); Apparently, GCC fails to
correctly distinguish nested levels of template parameters.


[Bug c++/67685] New: ICE on invalid requires expression

2015-09-22 Thread colu...@gmx-topmail.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67685

Bug ID: 67685
   Summary: ICE on invalid requires expression
   Product: gcc
   Version: c++-concepts
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: colu...@gmx-topmail.de
  Target Milestone: ---

void f(auto i) {requires {i;};}

int main() {f(0);}

=>

prog.cc: In instantiation of 'void f(auto:1) [with auto:1 = int]':
prog.cc:3:16:   required from here
prog.cc:1:17: internal compiler error: in tsubst_copy, at cp/pt.c:13689
 void f(auto i) {requires {i;};}
 ^
0x5ebae8 tsubst_copy
/home/heads/gcc/gcc-source/gcc/cp/pt.c:13689
0x5ec1f9 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
/home/heads/gcc/gcc-source/gcc/cp/pt.c:16451
0x5e8201 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/home/heads/gcc/gcc-source/gcc/cp/pt.c:15257
0x6dcd39 tsubst_simple_requirement
/home/heads/gcc/gcc-source/gcc/cp/constraint.cc:1506
0x6dcd39 tsubst_requirement
/home/heads/gcc/gcc-source/gcc/cp/constraint.cc:1562
0x6dcd39 tsubst_requirement_body
/home/heads/gcc/gcc-source/gcc/cp/constraint.cc:1585
0x6dcd39 tsubst_requires_expr(tree_node*, tree_node*, int, tree_node*)
/home/heads/gcc/gcc-source/gcc/cp/constraint.cc:1616
0x5ed221 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
/home/heads/gcc/gcc-source/gcc/cp/pt.c:16609
0x5e8201 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/home/heads/gcc/gcc-source/gcc/cp/pt.c:15257
0x5e7293 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/home/heads/gcc/gcc-source/gcc/cp/pt.c:14668
0x5e8095 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/home/heads/gcc/gcc-source/gcc/cp/pt.c:14840
0x5e6e31 instantiate_decl(tree_node*, int, bool)
/home/heads/gcc/gcc-source/gcc/cp/pt.c:21387
0x60233b instantiate_pending_templates(int)
/home/heads/gcc/gcc-source/gcc/cp/pt.c:21502
0x61fa4d c_parse_final_cleanups()
/home/heads/gcc/gcc-source/gcc/cp/decl2.c:4570


This code is ill-formed as per [expr.prim.req]/4, anyway; The
requires-expression is not allowed in an expression-statement.


[Bug c++/69309] New: Implement CWG 1780

2016-01-15 Thread colu...@gmx-topmail.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69309

Bug ID: 69309
   Summary: Implement CWG 1780
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: colu...@gmx-topmail.de
  Target Milestone: ---

auto l = [] {};
struct s {friend void decltype(l)::operator()() const;};

The above spuriously succeeds.

[Bug c++/69316] New: Implement CWG 393

2016-01-16 Thread colu...@gmx-topmail.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69316

Bug ID: 69316
   Summary: Implement CWG 393
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: colu...@gmx-topmail.de
  Target Milestone: ---

void f(int(&)[]);

This fails, although made well-formed as of core issue 393. Note that a fix
should presumably take EWG 118 into account.

[Bug c++/69390] New: dynamic_cast on rvalue fails

2016-01-20 Thread colu...@gmx-topmail.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69390

Bug ID: 69390
   Summary: dynamic_cast on rvalue fails
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: colu...@gmx-topmail.de
  Target Milestone: ---

The following code spuriously fails, because a "conversion to non-const
reference type 'struct main()::A&' from rvalue of type 'main()::A'" is
necessitated:

-

int main(){
struct A { virtual ~A() {}; };
struct B : A {} b;
dynamic_cast(static_cast(b));
}

[Bug c++/69410] New: friend declarations in local classes

2016-01-21 Thread colu...@gmx-topmail.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69410

Bug ID: 69410
   Summary: friend declarations in local classes
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: colu...@gmx-topmail.de
  Target Milestone: ---

void a();
void f() {
class A {
friend void ::a();
friend class Z;
};
}

---

The above fails for two (false) reasons, although it shouldn't. a is qualified,
therefore [class.friend]/11 does not apply. However, [class.friend]/11 does
apply in the subsequent declaration, making it well-formed - Z is declared to
be a local class. See the example in the aforementioned paragraph.

[Bug c++/67380] New: constexpr: Comparison of pointers to member array

2015-08-28 Thread colu...@gmx-topmail.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67380

Bug ID: 67380
   Summary: constexpr: Comparison of pointers to member array
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: colu...@gmx-topmail.de
  Target Milestone: ---

struct A {int arr[3] {1, 2, 3};} constexpr a{};

   static_assert( a.arr != a.arr+3 );

This fails with 20150813, while it shouldn't. [expr.const]/(2.19) states that
the result shall be specified for an application of an equality operator to be
a constant subexpression; And [expr.eq]/2 clearly makes this specified, such
that the assertion shouldn't fire.