[Bug c++/99980] New: Delayed parsing of noexcept doesn't work in member function template

2021-04-08 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99980

Bug ID: 99980
   Summary: Delayed parsing of noexcept doesn't work in member
function template
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

We should accept this:

struct S {
  template
  void f(T) noexcept(B);
  static constexpr bool B = true;
};

but we don't; we need something like

--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -30526,7 +30526,8 @@ cp_parser_single_declaration (cp_parser* parser,
  || decl_specifiers.type != error_mark_node))
 {
   decl = cp_parser_init_declarator (parser,
-   CP_PARSER_FLAGS_TYPENAME_OPTIONAL,
+   CP_PARSER_FLAGS_TYPENAME_OPTIONAL
+   | CP_PARSER_FLAGS_DELAY_NOEXCEPT,
_specifiers,
checks,
/*function_definition_allowed_p=*/true,

(but not when friend_p).  Found while looking into
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99806#c3.

[Bug c++/99806] [10/11 Regression] ICE: in tsubst_copy, at cp/pt.c:17247

2021-04-08 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99806

--- Comment #5 from Marek Polacek  ---
Another related test that we should probably accept:

// PR c++/99806

struct S {
  void f(auto, auto, int = 3);
};

void
g ()
{
  S s;
  s.f(1, 2);
}

[Bug c++/99806] [10/11 Regression] ICE: in tsubst_copy, at cp/pt.c:17247

2021-04-08 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99806

--- Comment #6 from Marek Polacek  ---
Since Comment 3 isn't a regression, I've opened bug 99980.

[Bug libgcc/99964] android(bionic) cannot find crti.o and crtn.o on aarch64

2021-04-08 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99964

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #7 from Marek Polacek  ---
Why do you keep adding Jakub to CC?  He's not a mingw maintainer.

[Bug c++/99806] [10/11 Regression] ICE: in tsubst_copy, at cp/pt.c:17247

2021-04-07 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99806

Marek Polacek  changed:

   What|Removed |Added

   Keywords|ice-on-invalid-code |ice-on-valid-code
   Priority|P3  |P2

--- Comment #2 from Marek Polacek  ---
// PR c++/99806

constexpr bool B = true;
template  concept C = requires (T a) { a.f(0); };
struct S { void f(auto) noexcept(B); };
static_assert(C);

[Bug c++/99806] [10/11 Regression] ICE: in tsubst_copy, at cp/pt.c:17247

2021-04-07 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99806

--- Comment #3 from Marek Polacek  ---
A test that should be accepted:

// PR c++/99806

struct S {
  template
  void f(T) noexcept(B);
  static constexpr bool B = true;
};

[Bug c++/99806] [10 Regression] ICE: in tsubst_copy, at cp/pt.c:17247

2021-04-09 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99806

Marek Polacek  changed:

   What|Removed |Added

Summary|[10/11 Regression] ICE: in  |[10 Regression] ICE: in
   |tsubst_copy, at |tsubst_copy, at
   |cp/pt.c:17247   |cp/pt.c:17247

--- Comment #8 from Marek Polacek  ---
Fixed on trunk so far.

[Bug bootstrap/99983] [9/10 regression] ICE in bootstrap while building libstdc++

2021-04-09 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99983

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #13 from Marek Polacek  ---
I see the ICE on x86_64 too.  Reducing...

$ xg++ -c fs_path.ii 
In file included from
/home/mpolacek/x/gcc10/x86_64-pc-linux-gnu/libstdc++-v3/include/unordered_map:46,
 from
/home/mpolacek/x/gcc10/x86_64-pc-linux-gnu/libstdc++-v3/include/functional:61,
 from
/home/mpolacek/x/gcc10/x86_64-pc-linux-gnu/libstdc++-v3/include/pstl/glue_algorithm_defs.h:13,
 from
/home/mpolacek/x/gcc10/x86_64-pc-linux-gnu/libstdc++-v3/include/algorithm:74,
 from
/home/mpolacek/src/gcc10/libstdc++-v3/src/c++17/fs_path.cc:35:
/home/mpolacek/x/gcc10/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/hashtable.h:1317:63:
internal compiler error: in merge_exception_specifiers, at cp/typeck2.c:2420
 1317 |  std::is_nothrow_copy_constructible<_Equal>::value)
  |   ^
0xe1e274 merge_exception_specifiers(tree_node*, tree_node*)
/home/mpolacek/src/gcc/gcc/cp/typeck2.c:2420
0xdef11c merge_types(tree_node*, tree_node*)
/home/mpolacek/src/gcc/gcc/cp/typeck.c:890
0xb14e18 duplicate_decls(tree_node*, tree_node*, bool, bool)
/home/mpolacek/src/gcc/gcc/cp/decl.c:2339
0xb3a380 grokfndecl
/home/mpolacek/src/gcc/gcc/cp/decl.c:10143
0xb468b3 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
/home/mpolacek/src/gcc/gcc/cp/decl.c:13903
0xb54ba2 start_function(cp_decl_specifier_seq*, cp_declarator const*,
tree_node*)
/home/mpolacek/src/gcc/gcc/cp/decl.c:16838
0xcb0635 cp_parser_function_definition_from_specifiers_and_declarator
/home/mpolacek/src/gcc/gcc/cp/parser.c:29904
0xc9f847 cp_parser_init_declarator
/home/mpolacek/src/gcc/gcc/cp/parser.c:21634
0xcb1f58 cp_parser_single_declaration
/home/mpolacek/src/gcc/gcc/cp/parser.c:30528
0xcb0bdd cp_parser_template_declaration_after_parameters
/home/mpolacek/src/gcc/gcc/cp/parser.c:30100
0xcb1b51 cp_parser_explicit_template_declaration
/home/mpolacek/src/gcc/gcc/cp/parser.c:30366
0xcb1bab cp_parser_template_declaration_after_export
/home/mpolacek/src/gcc/gcc/cp/parser.c:30385
0xc95af6 cp_parser_template_declaration
/home/mpolacek/src/gcc/gcc/cp/parser.c:16594
0xc913c4 cp_parser_declaration
/home/mpolacek/src/gcc/gcc/cp/parser.c:14070
0xc917d7 cp_parser_toplevel_declaration
/home/mpolacek/src/gcc/gcc/cp/parser.c:14168
0xc90f78 cp_parser_declaration_seq_opt
/home/mpolacek/src/gcc/gcc/cp/parser.c:13956
0xc9ce98 cp_parser_namespace_body
/home/mpolacek/src/gcc/gcc/cp/parser.c:20465
0xc9ce41 cp_parser_namespace_definition
/home/mpolacek/src/gcc/gcc/cp/parser.c:20443
0xc915c7 cp_parser_declaration
/home/mpolacek/src/gcc/gcc/cp/parser.c:14119
0xc917d7 cp_parser_toplevel_declaration
/home/mpolacek/src/gcc/gcc/cp/parser.c:14168

[Bug c++/98947] [10 Regression] Incorrect warning when using a ternary operator to select one of two volatile variables to write to

2021-04-09 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98947

Marek Polacek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #7 from Marek Polacek  ---
Fixed in GCC 10.4 too.

[Bug c++/99176] [8/9/10 Regression] GCC rejects const_cast of null pointer in constant expressions

2021-04-09 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99176

Marek Polacek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #7 from Marek Polacek  ---
Fixed in GCC 10.4 too.

[Bug c++/98333] [10 Regression] ICE in check_qualified_type, at tree.c:6593 since r10-1280-g78f7607db4c53f8c

2021-04-09 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98333

Marek Polacek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #7 from Marek Polacek  ---
Fixed for GCC 10.4/11.

[Bug c++/99374] [8/9/10 Regression] C++17/20 mode fails to recognise pointer-to-member functions of incomplete types in conditional expression

2021-04-09 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99374

Marek Polacek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #8 from Marek Polacek  ---
Fixed in GCC 10.4 too.

[Bug c++/99831] [10 Regression] ICE: in reshape_init, at cp/decl.c:6720

2021-04-09 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99831

Marek Polacek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #14 from Marek Polacek  ---
Fixed.

[Bug c++/99331] [8/9/10 Regression] -Wconversion false-positive in immediate context

2021-04-09 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99331

Marek Polacek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #10 from Marek Polacek  ---
Fixed in GCC 10.4 too.

[Bug c++/97966] [10 Regression] maybe_instantiate_noexcept

2021-04-09 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97966

Marek Polacek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #8 from Marek Polacek  ---
Fixed in GCC 10.4 too.

[Bug c++/99806] [10 Regression] ICE: in tsubst_copy, at cp/pt.c:17247

2021-04-09 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99806

Marek Polacek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #11 from Marek Polacek  ---
Fixed.

[Bug c++/99120] [8/9/10 Regression] ICE in -Wshadow in templated member function

2021-04-09 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99120

Marek Polacek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #5 from Marek Polacek  ---
Fixed in GCC 10.4 too.

[Bug c++/98899] [10 Regression] ICE in tsubst_copy, at cp/pt.c:16198 since r10-1280-g78f7607db4c53f8c

2021-04-09 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98899

Marek Polacek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #9 from Marek Polacek  ---
Not backporting to GCC 10.4 since it depends on another patch.

[Bug c++/91416] ICE in cp_check_const_attributes, at cp/decl2.c:1408

2021-04-09 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91416

Marek Polacek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #13 from Marek Polacek  ---
Fixed in GCC 10.4 too.

[Bug c++/97973] [9/10 Regression] ICE in tsubst_copy_and_build, at cp/pt.c:19577 since r265609

2021-04-09 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97973

Marek Polacek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #7 from Marek Polacek  ---
Fixed in GCC 10.4 too.

[Bug c++/98800] [8/9/10/11 Regression] ICE on invalid use of non-static member function in trailing return type since r8-2724

2021-04-10 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98800

Marek Polacek  changed:

   What|Removed |Added

   Priority|P2  |P4
   Keywords||error-recovery

--- Comment #4 from Marek Polacek  ---
I can see that error message now.  So, error-recovery and I suspect P4.

[Bug c++/100019] ICE Segmentation fault with try-catch block in lambda

2021-04-10 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100019

Marek Polacek  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 CC||mpolacek at gcc dot gnu.org
   Last reconfirmed||2021-04-10
   Keywords||ice-on-invalid-code
 Status|UNCONFIRMED |NEW

--- Comment #1 from Marek Polacek  ---
Confirmed.

[Bug target/100023] apple target cross compilation: fails configure: error: cannot compute suffix of object files: cannot compile

2021-04-10 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100023

Marek Polacek  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 CC||mpolacek at gcc dot gnu.org
 Status|UNCONFIRMED |RESOLVED

--- Comment #1 from Marek Polacek  ---
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details

So do just that.

Please stop opening these nonsensical "bug" reports.

[Bug c++/97536] [concepts] parser segfault for concept defined in function template

2021-04-19 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97536

Marek Polacek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #4 from Marek Polacek  ---
Fixed in GCC 11.

[Bug c++/67491] [meta-bug] concepts issues

2021-04-19 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67491
Bug 67491 depends on bug 97536, which changed state.

Bug 97536 Summary: [concepts] parser segfault for concept defined in function 
template
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97536

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

[Bug c++/100065] Conditional explicit doesn't work for deduction guide

2021-04-13 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100065

Marek Polacek  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
 Status|NEW |ASSIGNED
 CC||mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek  ---
What would be mine (but most likely a GCC 12 thing).

[Bug libgcc/100074] build fails for libgcc with --without-headers and --with-newlib

2021-04-13 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100074

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #3 from Marek Polacek  ---
Can you please resist your natural inclination to open a gcc bug any time you
see an error?

[Bug c++/100084] using enum lookup isn't type-only

2021-04-14 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100084

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
 CC||mpolacek at gcc dot gnu.org
   Keywords||accepts-invalid,
   ||rejects-valid
   Last reconfirmed||2021-04-14

--- Comment #2 from Marek Polacek  ---
Confirmed.

[Bug c++/96380] [10/11 Regression] ICE in tree check: expected integer_cst, have view_convert_expr in get_len, at tree.h:5954

2021-04-20 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96380

Marek Polacek  changed:

   What|Removed |Added

Summary|[10/11/12 Regression] ICE   |[10/11 Regression] ICE in
   |in tree check: expected |tree check: expected
   |integer_cst, have   |integer_cst, have
   |view_convert_expr in|view_convert_expr in
   |get_len, at tree.h:5954 |get_len, at tree.h:5954

--- Comment #5 from Marek Polacek  ---
(In reply to Marek Polacek from comment #3)
> (In reply to Jakub Jelinek from comment #2)
> > Marek, have you made any progress on this?
> 
> Not yet, sorry.  Hopefully this week then.

Testing a patch now.

[Bug c++/96379] [10/11/12 Regression] GCC accepts totally invalid template declaration

2021-04-20 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96379

Marek Polacek  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|ASSIGNED|RESOLVED

--- Comment #3 from Marek Polacek  ---
Dup of 96380 for which I posted a patch.

*** This bug has been marked as a duplicate of bug 96380 ***

[Bug c++/96380] [10/11/12 Regression] ICE in tree check: expected integer_cst, have view_convert_expr in get_len, at tree.h:5954

2021-04-20 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96380

--- Comment #6 from Marek Polacek  ---
*** Bug 96379 has been marked as a duplicate of this bug. ***

[Bug c++/100161] [10/11/12 Regression] Impossible to suppress Wtype-limits warning involving template parameter.

2021-04-20 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100161

Marek Polacek  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
   Last reconfirmed||2021-04-20
   Priority|P3  |P2
Summary|Impossible to suppress  |[10/11/12 Regression]
   |Wtype-limits warning|Impossible to suppress
   |involving template  |Wtype-limits warning
   |parameter.  |involving template
   ||parameter.
 CC||mpolacek at gcc dot gnu.org
   Target Milestone|--- |10.4
 Status|UNCONFIRMED |ASSIGNED
 Ever confirmed|0   |1
   Keywords||diagnostic

--- Comment #1 from Marek Polacek  ---
Started with my r11-155.

[Bug libstdc++/100164] [11 Regression] semaphore_impl not declared on AIX

2021-04-20 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100164

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org
 Status|NEW |ASSIGNED

[Bug c++/100109] [8/9/10/11 Regression] ICE: unexpected expression 'E' of kind template_parm_index

2021-04-16 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100109

Marek Polacek  changed:

   What|Removed |Added

   Last reconfirmed||2021-04-16
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Target Milestone|--- |8.5
Summary|ICE: unexpected expression  |[8/9/10/11 Regression] ICE:
   |'E' of kind |unexpected expression 'E'
   |template_parm_index |of kind template_parm_index
 CC||mpolacek at gcc dot gnu.org
   Priority|P3  |P2
   Keywords||ice-on-invalid-code

[Bug c++/99803] [9/10/11 Regression] ICE: in make_typename_type, at cp/decl.c:4057

2021-04-16 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99803

Marek Polacek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Marek Polacek  ---
Fixed.

[Bug c++/100109] [8/9/10/11 Regression] ICE: unexpected expression 'E' of kind template_parm_index

2021-04-16 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100109

--- Comment #1 from Marek Polacek  ---
Started with r251433.

[Bug c++/100122] template substitution triggers a segfault

2021-04-16 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100122

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED
 CC||mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek  ---
Already fixed by r11-3738.

[Bug c++/99968] [10/11 Regression] ICE on remove_const_t in requires-expression

2021-04-08 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99968

Marek Polacek  changed:

   What|Removed |Added

   Priority|P3  |P2
Summary|[11 Regression] ICE on  |[10/11 Regression] ICE on
   |remove_const_t in   |enum type> in
   |requires-expression |requires-expression
 CC||jason at gcc dot gnu.org,
   ||mpolacek at gcc dot gnu.org
   Target Milestone|--- |10.4

--- Comment #2 from Marek Polacek  ---
Started with r276764.

[Bug c++/99844] [9/10 Regression] ICE: unexpected expression 'B' of kind template_parm_index

2021-04-08 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99844

Marek Polacek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED
Summary|[9/10/11 Regression] ICE:   |[9/10 Regression] ICE:
   |unexpected expression 'B'   |unexpected expression 'B'
   |of kind template_parm_index |of kind template_parm_index

--- Comment #4 from Marek Polacek  ---
Fixed in GCC 11.

[Bug c++/99968] ICE on remove_const_t in requires-expression

2021-04-08 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99968

Marek Polacek  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=98533

--- Comment #5 from Marek Polacek  ---
Started with r241137, actually.

[Bug c++/97995] [8/9/10/11 Regression] ICE tree check: expected tree that contains 'typed' structure, have 'deferred_noexcept' in unify, at cp/pt.c:23473 since r7-4383-g51dc660315ef83dc

2021-04-09 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97995

Marek Polacek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #5 from Marek Polacek  ---
Yeah, I think so.  It's ICE-on-invalid and we don't usually backport these.

[Bug c++/100003] internal compiler error: in merge_exception_specifiers

2021-04-09 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=13

--- Comment #1 from Marek Polacek  ---
Without the directive:

q.C:6:22: error: declaration of ‘S::S() noexcept (T::value)’ has a different
exception specifier
6 | template S::S() noexcept(T::value) {}
  |  ^~~~
q.C:4:3: note: from previous declaration ‘S::S() noexcept
(((S*)this)->S::foo())’
4 |   S() noexcept(foo());
  |   ^

[Bug c++/100003] New: internal compiler error: in merge_exception_specifiers

2021-04-09 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=13

Bug ID: 13
   Summary: internal compiler error: in merge_exception_specifiers
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

The directive here is important:

# 9 "" 3
template  struct S {
  bool foo();
  S() noexcept(foo());
};
template S::S() noexcept(T::value) {}

$ ./cc1plus -quiet q.C
:13:49: internal compiler error: in merge_exception_specifiers, at
cp/typeck2.c:2420
0xe1e274 merge_exception_specifiers(tree_node*, tree_node*)
/home/mpolacek/src/gcc/gcc/cp/typeck2.c:2420
0xdef11c merge_types(tree_node*, tree_node*)
/home/mpolacek/src/gcc/gcc/cp/typeck.c:890
0xb14e18 duplicate_decls(tree_node*, tree_node*, bool, bool)
/home/mpolacek/src/gcc/gcc/cp/decl.c:2339
0xb3a380 grokfndecl
/home/mpolacek/src/gcc/gcc/cp/decl.c:10143
0xb468b3 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
/home/mpolacek/src/gcc/gcc/cp/decl.c:13903
0xb54ba2 start_function(cp_decl_specifier_seq*, cp_declarator const*,
tree_node*)
/home/mpolacek/src/gcc/gcc/cp/decl.c:16838
0xcb0635 cp_parser_function_definition_from_specifiers_and_declarator
/home/mpolacek/src/gcc/gcc/cp/parser.c:29904
0xc9f847 cp_parser_init_declarator
/home/mpolacek/src/gcc/gcc/cp/parser.c:21634
0xcb1f58 cp_parser_single_declaration
/home/mpolacek/src/gcc/gcc/cp/parser.c:30528
0xcb0bdd cp_parser_template_declaration_after_parameters
/home/mpolacek/src/gcc/gcc/cp/parser.c:30100
0xcb1b51 cp_parser_explicit_template_declaration
/home/mpolacek/src/gcc/gcc/cp/parser.c:30366
0xcb1bab cp_parser_template_declaration_after_export
/home/mpolacek/src/gcc/gcc/cp/parser.c:30385
0xc95af6 cp_parser_template_declaration
/home/mpolacek/src/gcc/gcc/cp/parser.c:16594
0xc913c4 cp_parser_declaration
/home/mpolacek/src/gcc/gcc/cp/parser.c:14070
0xc917d7 cp_parser_toplevel_declaration
/home/mpolacek/src/gcc/gcc/cp/parser.c:14168
0xc7d11f cp_parser_translation_unit
/home/mpolacek/src/gcc/gcc/cp/parser.c:4942
0xce022a c_parse_file()
/home/mpolacek/src/gcc/gcc/cp/parser.c:45268
0xea2d8e c_common_parse_file()
/home/mpolacek/src/gcc/gcc/c-family/c-opts.c:1218

[Bug bootstrap/99983] [9/10 regression] ICE in bootstrap while building libstdc++

2021-04-09 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99983

Marek Polacek  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=13

--- Comment #15 from Marek Polacek  ---
(In reply to Marek Polacek from comment #13)
> I see the ICE on x86_64 too.  Reducing...

Tracked in bug 13.

[Bug c++/100003] internal compiler error: in merge_exception_specifiers

2021-04-09 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=13

--- Comment #2 from Marek Polacek  ---
Started with r160297 or r160298 I think.

[Bug c++/100006] [8/9/10/11 Regression] ICE: in dependent_type_p, at cp/pt.c:26745

2021-04-09 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16

Marek Polacek  changed:

   What|Removed |Added

   Last reconfirmed||2021-04-09
   Keywords||ice-on-invalid-code
   Target Milestone|--- |8.5
 Status|UNCONFIRMED |NEW
   Priority|P3  |P2
 Ever confirmed|0   |1
 CC||jason at gcc dot gnu.org,
   ||mpolacek at gcc dot gnu.org
Summary|ICE: in dependent_type_p,   |[8/9/10/11 Regression] ICE:
   |at cp/pt.c:26745|in dependent_type_p, at
   ||cp/pt.c:26745

--- Comment #2 from Marek Polacek  ---
(In reply to 康桓瑋 from comment #0)
> Congratulations on hitting the 10,000 reports mark!

You helped :).

Started with r251433.

[Bug c++/100003] internal compiler error: in merge_exception_specifiers

2021-04-09 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=13

--- Comment #3 from Marek Polacek  ---
The problem is that, when we're in a system header,
check_redeclaration_exception_specification doesn't emit an error:

 1242   if (DECL_IN_SYSTEM_HEADER (old_decl))
 1243 complained = pedwarn (new_loc, OPT_Wsystem_headers, msg,
new_decl);

so then we crash here:

2420   gcc_checking_assert (!TREE_PURPOSE (add)
2421|| errorcount || !flag_exceptions
2422|| cp_tree_equal (noex, TREE_PURPOSE (add)));

[Bug c++/97966] [10 Regression] maybe_instantiate_noexcept

2021-04-11 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97966

--- Comment #10 from Marek Polacek  ---
Argh!  Sorry about that, will fix.

[Bug c++/100037] lookup doesn't find class template parameter in default member initializer of forward declared nested class template

2021-04-11 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100037

--- Comment #2 from Marek Polacek  ---
(Not a regression AFAICT.)

[Bug c++/100037] lookup doesn't find class template parameter in default member initializer of forward declared nested class template

2021-04-11 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100037

Marek Polacek  changed:

   What|Removed |Added

   Last reconfirmed||2021-04-11
 Ever confirmed|0   |1
 CC||mpolacek at gcc dot gnu.org
   Keywords||rejects-valid
 Status|UNCONFIRMED |NEW

--- Comment #1 from Marek Polacek  ---
Interesting.  Confirmed, thanks for the report.

[Bug c++/94775] [8/9/10 Regression] ICE in strip_typedefs, at cp/tree.c:1734 since r8-4668-g8a5ee94a082b3d48

2021-04-09 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94775

Marek Polacek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #20 from Marek Polacek  ---
I think I won't backport as the fix caused bug 99510.  Perhaps I could backport
both if someone really wants me to.

For now, fixed in GCC 11.

[Bug c++/97966] [10 Regression] maybe_instantiate_noexcept

2021-04-11 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97966

Marek Polacek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|REOPENED|RESOLVED

--- Comment #12 from Marek Polacek  ---
Should be fixed, sorry again for the breakage.

[Bug c++/100039] GCC can not bind lvalue to lvalue reference in brace-initialized-temporary expression

2021-04-11 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100039

Marek Polacek  changed:

   What|Removed |Added

   Last reconfirmed||2021-04-12
   Keywords||rejects-valid
 Status|UNCONFIRMED |NEW
 CC||mpolacek at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek  ---
Confirmed.  Not a regression.

[Bug c++/99080] New: Add !TYPE_P assert to type_dependent_expression_p

2021-02-12 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99080

Bug ID: 99080
   Summary: Add !TYPE_P assert to type_dependent_expression_p
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

As discussed here
,
type_dependent_expression_p should not be called with a type argument.  An
assert would help shake out such cases.

[Bug c++/99080] Add !TYPE_P assert to type_dependent_expression_p

2021-02-12 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99080

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Keywords||internal-improvement
 Ever confirmed|0   |1
   Last reconfirmed||2021-02-12
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org

[Bug c++/99116] [11 Regression] ICE in set_identifier_type_value_with_scope, at cp/name-lookup.c:4764

2021-02-15 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99116

Marek Polacek  changed:

   What|Removed |Added

   Target Milestone|--- |11.0
 Status|UNCONFIRMED |NEW
 CC||mpolacek at gcc dot gnu.org,
   ||nathan at gcc dot gnu.org
   Last reconfirmed||2021-02-16
 Ever confirmed|0   |1
   Priority|P3  |P2

--- Comment #1 from Marek Polacek  ---
Started with r11-7228.

[Bug c++/93383] ICE on accessing field of a structure which is non-type template parameter, -std=c++2a

2021-02-16 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93383

Marek Polacek  changed:

   What|Removed |Added

 CC||vopl at bk dot ru

--- Comment #8 from Marek Polacek  ---
*** Bug 99119 has been marked as a duplicate of this bug. ***

[Bug c++/99119] Class Types in Non-Type Template Parameters - ICE with templates nested

2021-02-16 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99119

Marek Polacek  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 CC||mpolacek at gcc dot gnu.org
 Status|UNCONFIRMED |RESOLVED

--- Comment #1 from Marek Polacek  ---
Likely a dup.

*** This bug has been marked as a duplicate of bug 93383 ***

[Bug c++/99118] ICE in alias_ctad_tweaks, at cp/pt.c:28569

2021-02-16 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99118

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #2 from Marek Polacek  ---
Must be a dup of one of PR93085 / PR93295 / PR96873.

[Bug c++/99120] [8/9/10/11 Regression] ICE in -Wshadow in templated member function

2021-02-16 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99120

Marek Polacek  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
 Status|NEW |ASSIGNED

[Bug c++/99062] [10 Regression] ICE in tree_to_uhwi, at tree.h:4579

2021-02-16 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99062

Marek Polacek  changed:

   What|Removed |Added

Summary|[10/11 Regression] ICE in   |[10 Regression] ICE in
   |tree_to_uhwi, at|tree_to_uhwi, at
   |tree.h:4579 |tree.h:4579

--- Comment #7 from Marek Polacek  ---
Fixed on trunk so far.

[Bug c++/99120] [8/9/10/11 Regression] ICE in -Wshadow in templated member function

2021-02-16 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99120

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 CC||mpolacek at gcc dot gnu.org
   Target Milestone|--- |8.5
   Last reconfirmed||2021-02-16
Summary|ICE in -Wshadow in  |[8/9/10/11 Regression] ICE
   |templated member function   |in -Wshadow in templated
   ||member function
   Keywords||ice-on-valid-code
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek  ---
Started with r214357.

[Bug c++/99120] [8/9/10/11 Regression] ICE in -Wshadow in templated member function

2021-02-16 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99120

Marek Polacek  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug middle-end/99109] [9/10/11 Regression] ICE: Error reporting routines re-entered

2021-02-15 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99109

Marek Polacek  changed:

   What|Removed |Added

   Target Milestone|--- |9.4

[Bug middle-end/99109] [9/10/11 Regression] ICE: Error reporting routines re-entered

2021-02-15 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99109

Marek Polacek  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2021-02-15
 Status|UNCONFIRMED |NEW

--- Comment #1 from Marek Polacek  ---
Confirmed.

[Bug c++/99132] [11 Regression] ICE in C++20 mode for constexpr not_null evaluation -- in cxx_eval_indirect_ref, at cp/constexpr.c:4905

2021-02-17 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99132

Marek Polacek  changed:

   What|Removed |Added

Summary|ICE in C++20 mode for   |[11 Regression] ICE in
   |constexpr not_null  |C++20 mode for constexpr
   |evaluation  --  in  |not_null evaluation  --  in
   |cxx_eval_indirect_ref, at   |cxx_eval_indirect_ref, at
   |cp/constexpr.c:4905 |cp/constexpr.c:4905
   Target Milestone|--- |11.0
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
 CC||mpolacek at gcc dot gnu.org
   Keywords||ice-on-valid-code
   Last reconfirmed||2021-02-17
   Priority|P3  |P1

--- Comment #3 from Marek Polacek  ---
Confirmed.

[Bug c++/99132] [11 Regression] ICE in C++20 mode for constexpr not_null evaluation -- in cxx_eval_indirect_ref, at cp/constexpr.c:4905

2021-02-17 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99132

--- Comment #5 from Marek Polacek  ---
Started with r11-5685.

[Bug c++/82235] Copy ctor is not found for copying array of an object when it's marked explicit

2021-02-05 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82235

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #4 from Marek Polacek  ---
Some debugging notes.

We're synthesizing the Bar::Bar(const Bar&) constructor in 
do_build_copy_constructor which creates a list of Bar's fields along with their
initializers.  Here we have

  m D.2398->m

because we're initializing m from m of a copy.  We pass this list down to
finish_mem_initializers, which passes each pair to perform_member_init. 
perform_member_init sees that we're initializing an array so creates a
VEC_INIT_EXPR via build_vec_init_expr.

VEC_INIT_EXPRs are expanded in cp_gimplify_expr, so we call build_vec_init to
do so.  We're initializing an array from another array and so do

4508   else if (type_build_ctor_call (type))
4509 elt_init = build_aggr_init (to, from, 0, complain)

where to = *D.2445 and from = *D.2447.

and build_aggr_init has

1822   if (init && init != void_type_node
1823   && TREE_CODE (init) != TREE_LIST
1824   && !(TREE_CODE (init) == TARGET_EXPR
1825&& TARGET_EXPR_DIRECT_INIT_P (init))
1826   && !DIRECT_LIST_INIT_P (init))
1827 flags |= LOOKUP_ONLYCONVERTING;

and init is an indirect_ref so we set L_O, never realizing that in this case we
don't want to set L_O.

I suppose we could introduce VEC_INIT_EXPR_DIRECT_INIT_P, set it in
perform_member_init, and then use it in cp_gimplify_expr to let build_aggr_init
know not to set L_O.  Because cp_gimplify_expr can't know in what context the
VEC_INIT_EXPR was created.

[Bug c++/95888] [9/10/11 Regression] Regression in 9.3. GCC freezes when compiling code using boost::poly_collection::segment

2021-02-05 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95888

--- Comment #5 from Marek Polacek  ---
Simplified test:

template  class A {
  A(int, int);
  template  friend class A;
  friend T;
};

template struct B {
  template struct C {
A begin() { return {1, 0}; }
  };
  template
  C fn();
};

int
main ()
{
  B b;
  b.fn().begin();
}

[Bug c++/98980] Very slow compilation with -Wduplicated-branches and ubsan

2021-02-05 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98980

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE
 CC||mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek  ---
Dup.

*** This bug has been marked as a duplicate of bug 82952 ***

[Bug c++/82952] Hang compiling with g++ -fsanitize=undefined -Wduplicated-branches

2021-02-05 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82952

Marek Polacek  changed:

   What|Removed |Added

 CC||sshannin at gmail dot com

--- Comment #8 from Marek Polacek  ---
*** Bug 98980 has been marked as a duplicate of this bug. ***

[Bug c++/99108] ICE in ix86_get_function_versions_dispatcher, at config/i386/i386-features.c:2862

2021-02-15 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99108

Marek Polacek  changed:

   What|Removed |Added

   Last reconfirmed||2021-02-15
 Status|UNCONFIRMED |NEW
 CC||mpolacek at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek  ---
Confirmed.

[Bug c++/99176] [8/9/10/11 Regression] GCC rejects const_cast of null pointer in constant expressions

2021-02-19 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99176

Marek Polacek  changed:

   What|Removed |Added

Summary|GCC rejects const_cast of   |[8/9/10/11 Regression] GCC
   |null pointer in constant|rejects const_cast of null
   |expressions |pointer in constant
   ||expressions
   Last reconfirmed||2021-02-19
 Status|UNCONFIRMED |NEW
   Priority|P3  |P2
   Keywords||rejects-valid
   Target Milestone|--- |9.4
 CC||mpolacek at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek  ---
Thanks for the report.  Started with r238909.

[Bug c++/99176] [8/9/10/11 Regression] GCC rejects const_cast of null pointer in constant expressions

2021-02-19 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99176

Marek Polacek  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org

--- Comment #2 from Marek Polacek  ---
I'll take a look.

[Bug c++/95888] [9 Regression] Regression in 9.3. GCC freezes when compiling code using boost::poly_collection::segment

2021-02-11 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95888

Marek Polacek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
Summary|[9/10 Regression]   |[9 Regression] Regression
   |Regression in 9.3. GCC  |in 9.3. GCC freezes when
   |freezes when compiling code |compiling code using
   |using   |boost::poly_collection::seg
   |boost::poly_collection::seg |ment
   |ment|
 Status|ASSIGNED|RESOLVED

--- Comment #11 from Marek Polacek  ---
Fixed.

[Bug c++/95888] [9/10 Regression] Regression in 9.3. GCC freezes when compiling code using boost::poly_collection::segment

2021-02-11 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95888

Marek Polacek  changed:

   What|Removed |Added

Summary|[9/10/11 Regression]|[9/10 Regression]
   |Regression in 9.3. GCC  |Regression in 9.3. GCC
   |freezes when compiling code |freezes when compiling code
   |using   |using
   |boost::poly_collection::seg |boost::poly_collection::seg
   |ment|ment

--- Comment #9 from Marek Polacek  ---
Fixed on trunk so far.  Testing gcc10 now.

[Bug c++/99076] Unclear error message when trailing angle bracket is missing

2021-02-11 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99076

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2021-02-11
 Ever confirmed|0   |1
   Keywords||diagnostic
 CC||mpolacek at gcc dot gnu.org

[Bug c++/97296] [10/11 Regression] g++ accepts-invalid after DR2352 fix

2021-02-11 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97296

Marek Polacek  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
 Status|NEW |ASSIGNED

--- Comment #2 from Marek Polacek  ---
Yeah, I'll take a look in the coming weeks.

[Bug c++/98810] [9/10/11 Regression] [C++20] ICE in tsubst_copy, at cp/pt.c:16771

2021-02-11 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98810

Marek Polacek  changed:

   What|Removed |Added

   Priority|P3  |P2
Summary|[C++20] ICE in tsubst_copy, |[9/10/11 Regression]
   |at cp/pt.c:16771|[C++20] ICE in tsubst_copy,
   ||at cp/pt.c:16771
 CC||jason at gcc dot gnu.org,
   ||mpolacek at gcc dot gnu.org
   Target Milestone|--- |9.4

--- Comment #2 from Marek Polacek  ---
r273592

[Bug c++/98804] GCC misparses template in pack expansion as comparison

2021-02-11 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98804

Marek Polacek  changed:

   What|Removed |Added

   Last reconfirmed||2021-02-12
 CC||mpolacek at gcc dot gnu.org
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

--- Comment #2 from Marek Polacek  ---
Confirmed.

[Bug c++/98844] Deduction guides don't inhibit the aggregate deduction candidate

2021-02-11 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98844

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED
 CC||mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek  ---
Fixed by r11-7096.

[Bug c++/97034] [11 Regression] ICE on C++20 code: gcc_assert failure in return type deduction (gcc/cp/pt.c:26984 in type_dependent_expression_p(tree_node*))

2021-02-11 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97034

--- Comment #6 from Marek Polacek  ---
(In reply to Arthur O'Dwyer from comment #5)
> Is mine the same bug? Mine is also a regression (trunk crashes where GCC
> 10.2 had succeeded).
> 
> // https://godbolt.org/z/Ysh6as
> struct C { void f(auto) noexcept; };
> void C::f(auto) noexcept(C::x) {}
> 
> Compile with -std=c++20:
> 
> 
> :3:29: error: 'x' is not a member of 'C'
> 3 | void C::f(auto) noexcept(C::x) {}
>   | ^
> :3:6: error: declaration of 'void C::f(auto:2)' has a different
> exception specifier
> 3 | void C::f(auto) noexcept(C::x) {}
>   |  ^
> :2:17: note: from previous declaration 'void C::f(auto:1) noexcept'
> 2 | struct C { void f(auto) noexcept; };
>   | ^
> :3:30: internal compiler error: in type_dependent_expression_p, at
> cp/pt.c:27166
> 3 | void C::f(auto) noexcept(C::x) {}
>   |  ^
> 0x1cc31d9 internal_error(char const*, ...)
>   ???:0
> 0x6b25f7 fancy_abort(char const*, int, char const*)
>   ???:0
> 0x8ee70a type_dependent_expression_p(tree_node*)
>   ???:0
> 0x137d4f3 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 >*))
>   ???:0
> 0x1381b55 walk_tree_without_duplicates_1(tree_node**, tree_node*
> (*)(tree_node**, int*, void*), void*, tree_node* (*)(tree_node**, int*,
> tree_node* (*)(tree_node**, int*, void*), void*, hash_set default_hash_traits >*))
>   ???:0
> 0x8ea937 instantiation_dependent_uneval_expression_p(tree_node*)
>   ???:0
> 0x8f2198 instantiation_dependent_expression_p(tree_node*)
>   ???:0
> 0x8f2216 uses_template_parms(tree_node*)
>   ???:0
> 0x78ffe8 duplicate_decls(tree_node*, tree_node*, bool, bool)
>   ???:0
> 0x79a2b6 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
> decl_context, int, tree_node**)
>   ???:0
> 0x79dda6 start_function(cp_decl_specifier_seq*, cp_declarator const*,
> tree_node*)
>   ???:0
> 0x8d803d c_parse_file()
>   ???:0
> 0xa54072 c_common_parse_file()
>   ???:0

I think that is a different problem (the original problem here was with
deduction guides).

[Bug c++/97034] [11 Regression] ICE on C++20 code: gcc_assert failure in return type deduction (gcc/cp/pt.c:26984 in type_dependent_expression_p(tree_node*))

2021-02-11 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97034

--- Comment #7 from Marek Polacek  ---
Candidate patch:

--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -27279,7 +27279,10 @@ type_dependent_expression_p (tree expression)
   && DECL_UNIQUE_FRIEND_P (expression)
   && (!DECL_FRIEND_CONTEXT (expression)
   || dependent_type_p (DECL_FRIEND_CONTEXT (expression
-  && !DECL_LOCAL_DECL_P (expression))
+  && !DECL_LOCAL_DECL_P (expression)
+  /* We build deduction guides without any DECL_CONTEXT, but they can
+be type-dependent.  */
+  && !deduction_guide_p (expression))
 {
   gcc_assert (!dependent_type_p (TREE_TYPE (expression))
  || undeduced_auto_decl (expression));

[Bug c++/97742] [10/11 Regression] endless loop with code reduced by creduce/cvise

2021-02-11 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97742

Marek Polacek  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
 Status|NEW |ASSIGNED

[Bug c++/97034] [11 Regression] ICE on C++20 code: gcc_assert failure in return type deduction (gcc/cp/pt.c:26984 in type_dependent_expression_p(tree_node*))

2021-02-11 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97034

--- Comment #8 from Marek Polacek  ---
Alternative patch that I'm more happy about:

--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -28761,6 +28761,7 @@ build_deduction_guide (tree type, tree ctor, tree
outer_args, tsubst_flags_t com
   tree ded_fn = build_lang_decl_loc (loc,
 FUNCTION_DECL,
 dguide_name (type), fntype);
+  DECL_CONTEXT (ded_fn) = type;
   DECL_ARGUMENTS (ded_fn) = fargs;
   DECL_ARTIFICIAL (ded_fn) = true;
   DECL_NONCONVERTING_P (ded_fn) = explicit_p;

[Bug c++/98820] Placeholder (auto) non-type template parameter wrongly deduced to 'const' for class type arguments

2021-02-11 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98820

Marek Polacek  changed:

   What|Removed |Added

   Keywords||rejects-valid
 CC||mpolacek at gcc dot gnu.org
   Last reconfirmed||2021-02-12
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

--- Comment #1 from Marek Polacek  ---
Confirmed, I guess.

[Bug c++/99201] [8/9/10/11 Regression] ICE in tsubst_copy, at cp/pt.c:16581

2021-02-22 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99201

Marek Polacek  changed:

   What|Removed |Added

   Target Milestone|--- |8.5
 CC||mpolacek at gcc dot gnu.org
Summary|ICE in tsubst_copy, at  |[8/9/10/11 Regression] ICE
   |cp/pt.c:16581   |in tsubst_copy, at
   ||cp/pt.c:16581
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Last reconfirmed||2021-02-22

--- Comment #1 from Marek Polacek  ---
Started with r273944.  The reduced test seems to be invalid.

[Bug c++/99200] __PRETTY_FUNCTION__ used as template parameter causes internal compiler error (segmentation fault)

2021-02-22 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99200

Marek Polacek  changed:

   What|Removed |Added

   Last reconfirmed||2021-02-22
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=93383
 Status|UNCONFIRMED |NEW
 CC||mpolacek at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Marek Polacek  ---
Looks like a dup of 93383.

[Bug c++/99176] [8/9/10/11 Regression] GCC rejects const_cast of null pointer in constant expressions

2021-02-22 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99176

--- Comment #3 from Marek Polacek  ---
Same problem for:

constexpr int* ptr = (int *) (const int *) nullptr;

[Bug c++/100161] [10/11 Regression] Impossible to suppress Wtype-limits warning involving template parameter.

2021-04-22 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100161

Marek Polacek  changed:

   What|Removed |Added

Summary|[10/11/12 Regression]   |[10/11 Regression]
   |Impossible to suppress  |Impossible to suppress
   |Wtype-limits warning|Wtype-limits warning
   |involving template  |involving template
   |parameter.  |parameter.

--- Comment #4 from Marek Polacek  ---
Fixed on trunk so far.

[Bug c++/91241] [8/9/10 Regression] internal compiler error: symtab_node::verify failed

2021-04-21 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91241

Marek Polacek  changed:

   What|Removed |Added

 CC||xavier at cremaschi dot fr

--- Comment #16 from Marek Polacek  ---
*** Bug 89605 has been marked as a duplicate of this bug. ***

[Bug c++/89605] A method cannot have two identical lambdas as default arguments

2021-04-21 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89605

Marek Polacek  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|NEW |RESOLVED

--- Comment #6 from Marek Polacek  ---
Dup I think.

*** This bug has been marked as a duplicate of bug 91241 ***

[Bug c++/96380] [10/11 Regression] ICE in tree check: expected integer_cst, have view_convert_expr in get_len, at tree.h:5954

2021-04-21 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96380

Marek Polacek  changed:

   What|Removed |Added

Summary|[10/11/12 Regression] ICE   |[10/11 Regression] ICE in
   |in tree check: expected |tree check: expected
   |integer_cst, have   |integer_cst, have
   |view_convert_expr in|view_convert_expr in
   |get_len, at tree.h:5954 |get_len, at tree.h:5954

--- Comment #8 from Marek Polacek  ---
Fixed on trunk (GCC 12) so far.  Will backport to 11.2 and 10.4.  Note: The
patch uses auto, needs tweaking before backporting to 10.

[Bug c++/100172] ICE with "concept concept" keyword

2021-04-21 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100172

Marek Polacek  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 CC||mpolacek at gcc dot gnu.org
   Last reconfirmed||2021-04-21
 Status|UNCONFIRMED |NEW

--- Comment #3 from Marek Polacek  ---
Confirmed.

[Bug c++/101988] [12 Regression] Accepts invalid new-expression of array of deduced class template

2021-08-20 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101988

Marek Polacek  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org

[Bug c++/102002] spec requires typename can be dropped when used as template function return type consisting of template parameter which is at global scope

2021-08-20 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102002

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |WORKSFORME
 CC||mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek  ---
You need to use -std=c++20.

[Bug c++/101940] Implement -fignored-attributes

2021-08-17 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101940

--- Comment #2 from Marek Polacek  ---
Possibly.  I thought I'd rather keep the names of the option and pragma the
same, but maybe that's not necessary.

[Bug c++/101940] Implement -fignored-attributes

2021-08-17 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101940

Marek Polacek  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org

--- Comment #4 from Marek Polacek  ---
Good point, I like that!

So, mine, I guess.

[Bug c++/102045] constructor is not being instantiated

2021-08-24 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102045

Marek Polacek  changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org,
   ||mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek  ---
Started with r11-6736.  I'm not sure if this is a desirable side effect of that
change.  I'll try to reduce this.

[Bug target/102105] New: x86_64: ABI break with vector in union and -mno-mmx -mavx

2021-08-27 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102105

Bug ID: 102105
   Summary: x86_64: ABI break with vector in union and -mno-mmx
-mavx
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

This looks like another ABI break.  Started with r271213.

-mno-mmx -mavx is an unusual combination I guess, but I'm filing this anyway.

$ cat m.c
void vector_1_x();
int main() { vector_1_x(); }
$ cat x.c
typedef int di;
typedef di __attribute__((vector_size(8))) v1di;
typedef union {
  v1di v;
  di a[1];
} u1di;
v1di g_v1di;
int pass_v1di_j;
di pass_v1di_a[1];
di pass_v1di_a_0;
u1di pass_v1di_u;
void test_v8qi();
void pass_v8qi() {}
void test_v1di();
void checkp_1di();
void pass_v1di(v1di v) {
  pass_v1di_u.v = v;
  pass_v1di_a_0 = pass_v1di_u.a[pass_v1di_j];
  checkp_1di(pass_v1di_a);
}
void vector_1_x() {
  test_v8qi();
  test_v1di();
}
$ cat y.c
typedef int qi;
typedef int __attribute__((mode(DI))) di;
int test_v8qi_i, checkp_1di_i;
extern __attribute__((__vector_size__(sizeof(di di g_v1di;
void abort();
typedef union {
  __attribute__((__vector_size__(2 * sizeof(qi qi v;
  qi a[8];
} u8qi;
void pass_v8qi();
void checkp_8qi(qi *p) {
  for (; 0;)
if (p)
  abort();
}
void test_v8qi() {
  u8qi u;
  qi *p = u.a;
  for (; test_v8qi_i;)
u.a[test_v8qi_i] = test_v8qi_i;
  pass_v8qi(u.v);
  checkp_8qi(p);
}
void pass_v1di();
void checkp_1di(di *p) {
  if (p[checkp_1di_i])
abort();
}
void test_v1di() { pass_v1di(g_v1di); }

And then:
$ xgcc-11 -c m.c
$ xgcc-11 -c x.c -mno-mmx -mavx
$ xgcc-9 -c y.c  -mno-mmx -mavx
$ xgcc-11 m.o x.o y.o -o foo
$ ./foo
Aborted (core dumped)
$ xgcc-10 -c y.c -mno-mmx -mavx
$ xgcc-11 m.o x.o y.o -o foo
$ ./foo && echo ok
ok

<    3   4   5   6   7   8   9   10   11   12   >