[Bug c++/114395] New: std::is_constructible_v result of const reference incorrect

2024-03-19 Thread yronglin777 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114395

Bug ID: 114395
   Summary: std::is_constructible_v result of const reference
incorrect
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yronglin777 at gmail dot com
  Target Milestone: ---

https://godbolt.org/z/h5af6f5x9
```
#include 

struct A {
int a;
};
struct B : public A {};

static_assert(!std::is_constructible_v);
static_assert(!std::is_constructible_v);

```
Clang and MSVC accepted this code, but gcc rejected.

```
:8:15: error: static assertion failed
8 | static_assert(!std::is_constructible_v);
  |   ^~
Compiler returned: 1
```

[Bug c++/110175] [GCC][Crash] GCC Crash on valid code

2023-06-08 Thread yronglin777 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110175

--- Comment #2 from Yrong  ---
Thanks!

[Bug c++/110175] New: [GCC][Crash] GCC Crash on valid code

2023-06-08 Thread yronglin777 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110175

Bug ID: 110175
   Summary: [GCC][Crash] GCC Crash on valid code
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yronglin777 at gmail dot com
  Target Milestone: ---

https://godbolt.org/z/Wf7M89v8x

```
template auto f(T t) -> decltype(++t) { return t; }
void f(...) {}
void g() { f(true); }
```

```
internal compiler error: error reporting routines re-entered.
0x23b8691 warning_at(unsigned int, int, char const*, ...)
???:0
0xd39208 cp_build_unary_op(tree_code, tree_node*, bool, int)
???:0
0xacd484 build_new_op(op_location_t const&, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node*, tree_node**, int)
???:0
0xd370e3 build_x_unary_op(unsigned int, tree_code, cp_expr, tree_node*, int)
???:0
0xcb685f tsubst(tree_node*, tree_node*, int, tree_node*)
???:0
0x23d8a2c pp_format(pretty_printer*, text_info*)
???:0
0x23d9c3d pp_format_verbatim(pretty_printer*, text_info*)
???:0
0x23d9d25 pp_verbatim(pretty_printer*, char const*, ...)
???:0
0x23b7895 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
???:0
0x23b8691 warning_at(unsigned int, int, char const*, ...)
???:0
0xd45bf1 check_return_expr(tree_node*, bool*)
???:0
0xcef6a3 finish_return_stmt(tree_node*)
???:0
0xcaf2f8 instantiate_decl(tree_node*, bool, bool)
???:0
0xcda84b instantiate_pending_templates(int)
???:0
0xb8e905 c_parse_final_cleanups()
???:0
0xdbe998 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
Compiler returned: 1
```

If remove the function body of 2 `f` functions, GCC will works well.
```
template auto f(T t) -> decltype(++t);
void f(...);
void g() { f(true); }
```

[Bug libstdc++/109024] New: [C++23][ranges][repeat_view] The default ctor unuseable

2023-03-04 Thread yronglin777 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109024

Bug ID: 109024
   Summary: [C++23][ranges][repeat_view] The default ctor
unuseable
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yronglin777 at gmail dot com
  Target Milestone: ---

The default ctor of std::ranges::repeat_view was unuseable.

https://godbolt.org/z/jxKMxEn7E

[P2474R2] https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2474r2.html
```
repeat_view() requires default_initializable = default;
```

```
#include 
#include 

void fn() {
std::ranges::repeat_view v;
}
```

```
In file included from :1:
/opt/compiler-explorer/gcc-trunk-20230304/include/c++/13.0.1/ranges: In
instantiation of 'constexpr std::ranges::repeat_view<_Tp,
_Bound>::repeat_view() requires  default_initializable<_Tp> [with _Tp = int;
_Bound = std::unreachable_sentinel_t]':
:5:35:   required from here
/opt/compiler-explorer/gcc-trunk-20230304/include/c++/13.0.1/ranges:7395:37:
error: could not convert '0' from 'int' to 'std::ranges::__detail::__box'
 7395 | __detail::__box<_Tp> _M_value = _Tp();
  | ^
  | |
  | int
Compiler returned: 1
```

[Bug c++/108333] New: [10.3/10.4/11/12/13/trunk Regression] The behavior of direct-non-list-initialized is not correct, parsing error on valid code

2023-01-07 Thread yronglin777 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108333

Bug ID: 108333
   Summary: [10.3/10.4/11/12/13/trunk Regression] The behavior of
direct-non-list-initialized is not correct, parsing
error on valid code
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: yronglin777 at gmail dot com
  Target Milestone: ---

GCC parsing error on valid code:

Compiler Explorer: https://godbolt.org/z/K6edrdTG5 (Thanks Nikolas Klauser)

```
struct NonCopyable {
  NonCopyable(int) {}
  NonCopyable(const NonCopyable&) = delete;
};

struct S {
  S(int i) : val(NonCopyable{1}) {}

  [[no_unique_address]] NonCopyable val;
};

struct T {
  T(int i) : val(NonCopyable{1}) {}

  NonCopyable val;
};

```

This code accept by GCC[9/10.1/10.2], clang and MSVC, but compile failed with
GCC[10.3/10.4/11/12/13/trunk], seems a regression.