[Bug c++/101233] ICE when using ::ranges::v3::to

2021-06-28 Thread 475647575 at qq dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101233

--- Comment #4 from 欢乐的0403 <475647575 at qq dot com> ---
Good, looking forward to it being fixed.

[Bug c++/101233] ICE when using ::ranges::v3::to

2021-06-28 Thread 475647575 at qq dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101233

--- Comment #2 from 欢乐的0403 <475647575 at qq dot com> ---
This stumps me. I don't know if the code is valid or not.
But these code compiles:

v | ::ranges::v3::to;

v | ::ranges::v3::to_vector;


So I guess the code is more likely to be valid?

[Bug c++/101233] New: ICE when using ::ranges::v3::to

2021-06-27 Thread 475647575 at qq dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101233

Bug ID: 101233
   Summary: ICE when using ::ranges::v3::to
   Product: gcc
   Version: 11.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: 475647575 at qq dot com
  Target Milestone: ---

Try the following code:

#include 
#include 

int main(){
std::vector v{1,2,3,4,5};
v | ::ranges::v3::to;
}


godbolt link:https://godbolt.org/z/oxnbad9M6

[Bug c++/98413] ICE with placement new

2020-12-21 Thread 475647575 at qq dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98413

--- Comment #1 from 欢乐的0403 <475647575 at qq dot com> ---
// A smaller example:
#include 
struct A{
int m;
};

A a;
void f(int A::*member_pointer)
{
new (&(a.*member_pointer)) int;
}
//https://godbolt.org/z/KhPq9e

[Bug c++/98413] New: ICE with placement new

2020-12-21 Thread 475647575 at qq dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98413

Bug ID: 98413
   Summary: ICE with placement new
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: 475647575 at qq dot com
  Target Milestone: ---

// example program
#include 
struct A{
int m{};
};
template
void f(A *instance, T A::*member_pointer)
{
new (&(instance->*member_pointer)) T{0};
}

int main()
{
A a;
f(&a, &A::m);
return 0;
}
---
error: 

: In instantiation of 'void f(A*, T A::*) [with T = int]':
:14:16:   required from here
:8:5: internal compiler error: tree check: expected integer_type or
enumeral_type or boolean_type or real_type or fixed_point_type, have
offset_type in get_offset_range, at builtins.c:5108
8 | new (&(instance->*member_pointer)) T{0};
  | ^~~
0x1cb9849 internal_error(char const*, ...)
???:0
0x673fd7 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
???:0
0xabc5d8 compute_objsize(tree_node*, int, access_ref*, range_query*)
???:0
0x7ee121 build_new(unsigned int, vec**,
tree_node*, tree_node*, vec**, int, int)
???:0
0x90fa2f instantiate_decl(tree_node*, bool, bool)
???:0
0x950f5b instantiate_pending_templates(int)
???:0
0x7c21b9 c_parse_final_cleanups()
???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
ASM generation compiler returned: 1


gcc -v:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/gcc11/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --disable-multilib --prefix=/gcc11
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20201217 (experimental) (GCC)
-
exact gcc commit used:
https://github.com/gcc-mirror/gcc/commit/6f8486523f61bf0aa476dfa4197d1e3b71a0a8f3

This bug can be re-producted in godbolt:
https://godbolt.org/z/TeTbET