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

2021-03-01 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

 CC||mpolacek at gcc dot gnu.org
 Ever confirmed|0   |1
Summary|-Wconversion false-positive |[8/9/10/11 Regression]
   |in immidiate context|-Wconversion false-positive
   ||in immediate context
   Target Milestone|--- |8.5
   Priority|P3  |P2
   Last reconfirmed||2021-03-01
 Status|UNCONFIRMED |NEW

--- Comment #1 from Marek Polacek  ---
Confirmed.  Started in GCC 7.

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

2021-03-01 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|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org

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

commit 16b61424dd309f61326f577a6deb8487c6c1f291
Author: Jason Merrill 
Date:   Fri Oct 21 15:45:45 2016 -0400

re PR c++/77656 (64-bit integral template parameter gets incorrectly sized
as 32-bits)

PR c++/77656
* pt.c (convert_template_argument): Call convert_nontype_argument
on value-dependent but not type-dependent arguments.
(convert_nontype_argument): Handle value-dependent arguments.
(canonicalize_expr_argument): New.
(deducible_expression, unify): Skip CONVERT_EXPR.
* error.c (dump_template_argument): Likewise.
* mangle.c (write_expression): Likewise.

From-SVN: r241425

think I'll have a look at this myself, though.

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

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

--- Comment #4 from Marek Polacek  ---
This is caused by this change:

@@ -7278,7 +7306,7 @@ convert_template_argument (tree parm,
  val = error_mark_node;
}
}
-  else if (!dependent_template_arg_p (orig_arg)
+  else if (!type_dependent_expression_p (orig_arg)
   && !uses_template_parms (t))
/* We used to call digest_init here.  However, digest_init
   will report errors, which we don't want when complain

Here orig_arg is SIZEOF_EXPR; dependent_template_arg_p (orig_arg) was true,
but  type_dependent_expression_p (orig_arg) is false so we warn in
convert_nontype_argument.

[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-03-03 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97034

Marek Polacek  changed:

   What|Removed |Added

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

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

[Bug c++/99009] [9/10 Regression] ICE in type_dependent_expression_p, at cp/pt.c:27265

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

Marek Polacek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
Summary|[9/10/11 Regression] ICE in |[9/10 Regression] ICE in
   |type_dependent_expression_p |type_dependent_expression_p
   |, at cp/pt.c:27265  |, at cp/pt.c:27265

--- Comment #4 from Marek Polacek  ---
Fixed in GCC 11.  Probably not going to backport.

[Bug c++/99361] "unused variable" warning on a used variable in template lambda

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

Marek Polacek  changed:

   What|Removed |Added

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

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

[Bug c++/99273] List initialization prefers initializer_list a little too strongly

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

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #1 from Marek Polacek  ---
Um, confirmed, I guess.

[Bug c++/99018] Comparing address of array element not considered a constant expression in certain contexts

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

Marek Polacek  changed:

   What|Removed |Added

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

[Bug c++/99365] [11 Regression] ICE on partial specialization with constrained placeholder NTTP

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

Marek Polacek  changed:

   What|Removed |Added

Summary|ICE on partial  |[11 Regression] ICE on
   |specialization with |partial specialization with
   |constrained placeholder |constrained placeholder
   |NTTP|NTTP
 Ever confirmed|0   |1
   Priority|P3  |P1
   Last reconfirmed||2021-03-03
 Status|UNCONFIRMED |NEW
 CC||mpolacek at gcc dot gnu.org,
   ||ppalka at gcc dot gnu.org
   Target Milestone|--- |11.0

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

[Bug c++/99366] [11 Regression] Partial specialization with constrained placeholder NTTP is not more specialized

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

Marek Polacek  changed:

   What|Removed |Added

   Last reconfirmed||2021-03-03
 Status|UNCONFIRMED |NEW
 CC||mpolacek at gcc dot gnu.org,
   ||ppalka at gcc dot gnu.org
 Ever confirmed|0   |1
   Priority|P3  |P1
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=99365
Summary|Partial specialization with |[11 Regression] Partial
   |constrained placeholder |specialization with
   |NTTP is not more|constrained placeholder
   |specialized |NTTP is not more
   ||specialized
   Target Milestone|--- |11.0

--- Comment #1 from Marek Polacek  ---
Started with r11-7454.  Might be the same underlying issue.

[Bug c++/96474] Internal compiler error with template struct inside template struct

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

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  ---
Now fixed by r11-7483.  Let's add the tests.

[Bug c++/96474] Internal compiler error with template struct inside template struct

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

Marek Polacek  changed:

   What|Removed |Added

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

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

[Bug c++/99180] [10/11 Regression] ICE with alias template and empty parameter pack

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

Marek Polacek  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=99118
 CC||mpolacek at gcc dot gnu.org

--- Comment #3 from Marek Polacek  ---
Probably a dup of 99118 which itself is likely a dup.

[Bug c++/99192] A wrong Aggregate initialization for a union with a variant member of non-aggregate class type

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

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #1 from Marek Polacek  ---
Confirmed.  I think this might be too risky to change in GCC 11.  Not a
regression, either.

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

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

--- Comment #6 from Marek Polacek  ---
(In reply to JoaoBapt from comment #4)
> (In reply to Marek Polacek from comment #2)
> > Looks like a dup of 93383.
> 
> No, because it works perfectly when I substitute __PRETTY_FUNCTION__ for any
> other string literal

That doesn't really matter; the ICE is very much like the one I described in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93383#c3, only this time we don't
have a COMPONENT_REF that is type-less, it's an identifier_node.  Therefore I
suspect the fix ought to handle both issues.

[Bug c++/99209] lambdas in function template signatures instantiated with wrong semantic context

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

Marek Polacek  changed:

   What|Removed |Added

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

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

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

2021-03-03 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

 CC||mpolacek at gcc dot gnu.org
   Keywords|ice-on-invalid-code |ice-on-valid-code
Summary|[10/11 Regression] ICE in   |[9/10/11 Regression] ICE in
   |tsubst_copy_and_build, at   |tsubst_copy_and_build, at
   |cp/pt.c:19577 since |cp/pt.c:19577 since r265609
   |r10-6170-g8a990ffafaaa1898  |

--- Comment #2 from Marek Polacek  ---
Modified, valid test:

void (*foo[1])(const int &);

template
void fn()
{
  (foo[0])(1.1);
}


Started with r265609.

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

2021-03-03 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

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

[Bug c++/99379] lambda declared with deduced type 'auto' can appear in its own initializer

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

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #2 from Marek Polacek  ---
(In reply to 康桓瑋 from comment #1)
> I find this: 
> https://stackoverflow.com/questions/25693676/auto-variable-used-in-lambda-in-
> its-own-initializer
> So this is not a bug.

Closing then.

[Bug c++/99387] ICE when mixing CNTTP with deduction guides

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

Marek Polacek  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2021-03-04
 CC||jason at gcc dot gnu.org,
   ||mpolacek at gcc dot gnu.org,
   ||ppalka at gcc dot gnu.org
   Keywords||ice-on-valid-code

--- Comment #2 from Marek Polacek  ---
Confirmed.  The ICE started with r11-2015, and then r11-6816 turned it into
another ICE.

Never worked so not a regression.  But if the fix is for C++20-only paths, we
could still go and fix it.

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

2021-03-04 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

   Priority|P3  |P2

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

2021-03-04 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|NEW |ASSIGNED
   Target Milestone|--- |8.5
Summary|C++17/20 mode fails to  |[8/9/10/11 Regression]
   |recognise pointer-to-member |C++17/20 mode fails to
   |functions of incomplete |recognise pointer-to-member
   |types in conditional|functions of incomplete
   |expression  |types in conditional
   ||expression
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
 CC||mpolacek at gcc dot gnu.org

--- Comment #4 from Marek Polacek  ---
I suspect we can treat it as a regression then; g++-6 accepted the code even
with -std=c++17.

I think I have a patch.

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

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

--- Comment #8 from Marek Polacek  ---
It probably needs target c++2a instead.

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

2021-03-05 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

Summary|[8/9/10/11 Regression] ICE  |[8/9/10 Regression] ICE in
   |in -Wshadow in templated|-Wshadow in templated
   |member function |member function

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

[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-03-05 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

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

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

[Bug ipa/99309] [10/11 Regression] Segmentation fault with __builtin_constant_p usage at -O2

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

Marek Polacek  changed:

   What|Removed |Added

  Component|c++ |ipa
 CC||mpolacek at gcc dot gnu.org

--- Comment #3 from Marek Polacek  ---
Moving into ipa then.

[Bug c++/99472] [modules] std=c++2b flag appears incompatible with C++20 module code

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

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
 Ever confirmed|0   |1
 CC||mpolacek at gcc dot gnu.org
   Last reconfirmed||2021-03-08

--- Comment #1 from Marek Polacek  ---
get_cxx_dialect_name doesn't handle C++23 yet.  Looks like Nathan is on it.

[Bug c++/96268] class-type NTTP CTAD for string-literal aggregate fails on aggregate initialization

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

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #5 from Marek Polacek  ---
Works since r11-7102.  Will add the test, since we don't have it yet.  Thanks
Will!

[Bug c++/96268] class-type NTTP CTAD for string-literal aggregate fails on aggregate initialization

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

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #7 from Marek Polacek  ---
Done.

[Bug c++/99318] [10/11 Regression] -Wdeprecated-declarations where non-should be?

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

Marek Polacek  changed:

   What|Removed |Added

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

[Bug c++/99478] [9/10/11 Regression] ICE when decltype lambda in template list

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

Marek Polacek  changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
 CC||mpolacek at gcc dot gnu.org
Summary|ICE when decltype lambda in |[9/10/11 Regression] ICE
   |template list   |when decltype lambda in
   ||template list
   Priority|P3  |P2
   Target Milestone|--- |9.4
   Last reconfirmed||2021-03-09

--- Comment #1 from Marek Polacek  ---
Started with r269972.  Invalid, I think.

[Bug c++/99500] [11 Regression] ICE: tree check: expected tree that contains 'decl minimal' structure, have 'error_mark' in cp_parser_requirement_parameter_list, at cp/parser.c:28828

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

Marek Polacek  changed:

   What|Removed |Added

   Keywords||error-recovery
 CC||mpolacek at gcc dot gnu.org
 Ever confirmed|0   |1
   Target Milestone|--- |11.0
   Last reconfirmed||2021-03-10
 Status|UNCONFIRMED |NEW

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

[Bug c++/99500] [11 Regression] ICE: tree check: expected tree that contains 'decl minimal' structure, have 'error_mark' in cp_parser_requirement_parameter_list, at cp/parser.c:28828

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

Marek Polacek  changed:

   What|Removed |Added

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

[Bug c++/99511] default arguments are allowed for parameters of a requires expression

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

Marek Polacek  changed:

   What|Removed |Added

   Keywords||accepts-invalid
 Ever confirmed|0   |1
 CC||mpolacek at gcc dot gnu.org
   Last reconfirmed||2021-03-10
 Status|UNCONFIRMED |NEW

--- Comment #1 from Marek Polacek  ---
Confirmed: [expr.prim.req]p4: "A local parameter of a requires-expression shall
not have a default argument."

[Bug c++/97214] [8/9/10/11 Regression] ICE in lookup_template_class_1, at cp/pt.c:9896

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

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #3 from Marek Polacek  ---
This has been fixed on trunk with r11-7418, so it's a dup.

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

[Bug c++/95451] [8/9/10 regression] ICE for lambda capturing this and calling operator() since r8-2720-gf44a8dd56f5bfbd0

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

Marek Polacek  changed:

   What|Removed |Added

 CC||sfranzen85 at hotmail dot com

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

[Bug c++/90480] [8/9/10/11 Regression] ICE when calling operator() inside a lambda defined in a template class method

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

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #5 from Marek Polacek  ---
Dup of bug 95451 which is now fixed on trunk.

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

[Bug c++/95451] [8/9/10 regression] ICE for lambda capturing this and calling operator() since r8-2720-gf44a8dd56f5bfbd0

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

Marek Polacek  changed:

   What|Removed |Added

 CC||gcc at olupton dot com

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

[Bug c++/54367] [meta-bug] lambda expressions

2021-03-11 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54367
Bug 54367 depends on bug 90480, which changed state.

Bug 90480 Summary: [8/9/10/11 Regression] ICE when calling operator() inside a 
lambda defined in a template class method
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90480

   What|Removed |Added

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

[Bug c++/97372] [8/9/10/11 Regression] ICE in Tracy 0.7.3 in template class since r8-2836-gb54d4018b17c8e7b

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

Marek Polacek  changed:

   What|Removed |Added

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

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

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

[Bug c++/95870] [8/9/10/11 Regression] ICE (segmentation fault) in most_general_template(), in gcc/cp/pt.c

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

Marek Polacek  changed:

   What|Removed |Added

 CC||public at enkore dot de

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

[Bug c++/95870] [8/9/10/11 Regression] ICE (segmentation fault) in most_general_template(), in gcc/cp/pt.c

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

--- Comment #6 from Marek Polacek  ---
Valid test from bug 97372:

class Lockable {
public:
  Lockable(int *);
};
template  class ThreadTask2 {
  Lockable _state_mutex{[]() -> int * { static int srcloc; return 0; }()};
public:
  ThreadTask2() {}
};
void x() { ThreadTask2 foo; }

[Bug c++/98352] [9/10/11 Regression] ICE in implicitly_declare_fn, at cp/method.c:2914 since r9-6097-g9d35a27a8353b57e

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

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #2 from Marek Polacek  ---
My patch for PR94751 will fix this too if it's tweaked like this:

--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -3002,7 +3002,7 @@ implicitly_declare_fn (special_function_kind kind, tree
type,
 member initializer (c++/89914).  Also, in C++98, we might have
 failed to deduce RAISES, so try again but complain this time.  */
  if (cxx_dialect < cxx11)
-   synthesized_method_walk (type, kind, const_p, nullptr, nullptr,
+   synthesized_method_walk (type, kind, const_p, &raises, nullptr,
 nullptr, nullptr, /*diag=*/true,
 &inherited_ctor, inherited_parms);
  /* We should have seen an error at this point.  */

[Bug c++/94751] [9/10/11 Regression] ICE on invalid code in maybe_instantiate_noexcept

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

--- Comment #6 from Marek Polacek  ---
Patch posted: https://gcc.gnu.org/pipermail/gcc-patches/2021-March/566369.html

Also note https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98352#c2

[Bug c++/99565] [11 Regression] Bogus identical branches warning when returning references to union members

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

Marek Polacek  changed:

   What|Removed |Added

 Status|WAITING |NEW
 CC||hubicka at gcc dot gnu.org,
   ||mpolacek at gcc dot gnu.org
   Priority|P3  |P1
   Target Milestone|--- |11.0
Summary|Bogus identical branches|[11 Regression] Bogus
   |warning when returning  |identical branches warning
   |references to union members |when returning references
   ||to union members

--- Comment #3 from Marek Polacek  ---
Confirmed then.  It's actually an 11 regression, started with r11-5181.

[Bug c++/99566] designated initialization rejects explicit constructor

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

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #1 from Marek Polacek  ---
This is DR2359 and we already have a bug for that
(https://gcc.gnu.org/projects/cxx-dr-status.html): 91319

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

[Bug c++/91319] Designated initializer doesn't support direct-initialization

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

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

[Bug c++/91319] Designated initializer doesn't support direct-initialization

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

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #3 from Marek Polacek  ---
Mine for GCC 12.

[Bug c++/99571] ICE for NTTP with pointer to array of union

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

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #1 from Marek Polacek  ---
Confirmed.  ICE started with r11-2237.  Before that:

error: ‘& i.I::.Ia’ is not a valid template
argument of type ‘int*’ because ‘i.I::.Ia’ is not
a variable
7 | [[maybe_unused]]Cc;
  |^

Not sure if we should treat this as a regression.

[Bug c++/99586] Use of class template identifier checked for CTAD before instantiation

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

Marek Polacek  changed:

   What|Removed |Added

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

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

[Bug c++/99565] [11 Regression] Bogus identical branches warning when returning references to union members

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

--- Comment #5 from Marek Polacek  ---
I think I added OEP_LEXICOGRAPHIC specifically for -Wduplicated-branches
(do_warn_duplicated_branches used it first), so we can have it do whatever we
want for the warning.  So your change looks fine to me.

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

2021-03-17 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

Summary|[9/10/11 Regression] ICE in |[9/10 Regression] ICE in
   |tsubst_copy_and_build, at   |tsubst_copy_and_build, at
   |cp/pt.c:19577 since r265609 |cp/pt.c:19577 since r265609

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

[Bug c++/99650] ICE when trying to form reference to void in structured binding

2021-03-18 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99650

Marek Polacek  changed:

   What|Removed |Added

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

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

[Bug c++/99655] [11 regression] Lots of ICEs in g++.dg/torture/pr85013.C after r11-7723

2021-03-18 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99655

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #2 from Marek Polacek  ---
Resolved by r11-7726.

[Bug c++/99500] [11 Regression] ICE: tree check: expected tree that contains 'decl minimal' structure, have 'error_mark' in cp_parser_requirement_parameter_list, at cp/parser.c:28828

2021-03-18 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99500

Marek Polacek  changed:

   What|Removed |Added

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

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

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

2021-03-18 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 99500, which changed state.

Bug 99500 Summary: [11 Regression] ICE: tree check: expected tree that contains 
'decl minimal' structure, have 'error_mark' in 
cp_parser_requirement_parameter_list, at cp/parser.c:28828
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99500

   What|Removed |Added

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

[Bug c++/99659] [10/11 Regression] internal compiler error: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in synthesize_implicit_template_parm, at cp/parser.c:4541

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

Marek Polacek  changed:

   What|Removed |Added

   Priority|P3  |P4
   Target Milestone|--- |11.0
Summary|internal compiler error:|[10/11 Regression] internal
   |tree check: expected tree   |compiler error: tree check:
   |that contains 'decl common' |expected tree that contains
   |structure, have |'decl common' structure,
   |'error_mark' in |have 'error_mark' in
   |synthesize_implicit_templat |synthesize_implicit_templat
   |e_parm, at  |e_parm, at
   |cp/parser.c:45415   |cp/parser.c:45415
 CC||mpolacek at gcc dot gnu.org
   Last reconfirmed||2021-03-19
   Keywords||error-recovery
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

[Bug c++/99701] std::nullptr_t can be compared with relational ops

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

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #1 from Marek Polacek  ---
Mine (for GCC 12).

[Bug c++/99318] [10 Regression] -Wdeprecated-declarations where non-should be?

2021-03-23 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99318

Marek Polacek  changed:

   What|Removed |Added

Summary|[10/11 Regression]  |[10 Regression]
   |-Wdeprecated-declarations   |-Wdeprecated-declarations
   |where non-should be?|where non-should be?

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

[Bug c++/99729] New: Tweak -Wdeprecated-declarations with namespaces

2021-03-23 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99729

Bug ID: 99729
   Summary: Tweak -Wdeprecated-declarations with namespaces
   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: ---

namespace [[deprecated]] N { struct S { }; }
using namespace N;
S s;

we should warn about the using-directive, but not also the declaration 
of 's'.

(From https://gcc.gnu.org/pipermail/gcc-patches/2021-March/567148.html.)

[Bug c++/99729] Tweak -Wdeprecated-declarations with namespaces

2021-03-23 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99729

Marek Polacek  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2021-03-23
 Ever confirmed|0   |1
   Keywords||diagnostic

[Bug c++/98942] [C++23] Implement P1102R2 - Down with ()!

2021-03-25 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98942

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #3 from Marek Polacek  ---
Implemented in GCC 11.

[Bug c++/98940] Implement C++23 language features

2021-03-25 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98940
Bug 98940 depends on bug 98942, which changed state.

Bug 98942 Summary: [C++23] Implement P1102R2 - Down with ()!
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98942

   What|Removed |Added

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

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

2021-03-25 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

Summary|[8/9/10/11 Regression]  |[8/9/10 Regression]
   |-Wconversion false-positive |-Wconversion false-positive
   |in immediate context|in immediate context

--- Comment #6 from Marek Polacek  ---
Fixed on trunk thus far.

[Bug c++/94751] [9/10/11 Regression] ICE on invalid code in maybe_instantiate_noexcept

2021-03-25 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94751

Marek Polacek  changed:

   What|Removed |Added

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

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

[Bug c++/99775] segmentation fault on template variable as template parameter

2021-03-25 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99775

Marek Polacek  changed:

   What|Removed |Added

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

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

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

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

2021-03-25 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||wouter at voti dot nl

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

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

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

--- Comment #8 from Marek Polacek  ---
Yeah, that's expected (but it's a bug!):
https://gcc.gnu.org/pipermail/gcc-patches/2021-March/566449.html

Opening a separate issue would be nice, thanks.

[Bug c++/99795] -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context

2021-03-26 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99795

Marek Polacek  changed:

   What|Removed |Added

   Last reconfirmed||2021-03-26
   Keywords||accepts-invalid
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek  ---
Confirmed, thanks for opening.

[Bug c++/99795] [8/9/10/11 Regression] -Wnarrowing/-Woverflow false-negative in constant expression in undeduced context

2021-03-26 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99795

Marek Polacek  changed:

   What|Removed |Added

   Target Milestone|--- |8.5
Summary|-Wnarrowing/-Woverflow  |[8/9/10/11 Regression]
   |false-negative in constant  |-Wnarrowing/-Woverflow
   |expression in undeduced |false-negative in constant
   |context |expression in undeduced
   ||context

[Bug c++/98352] [9/10/11 Regression] ICE in implicitly_declare_fn, at cp/method.c:2914 since r9-6097-g9d35a27a8353b57e

2021-03-26 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98352

Marek Polacek  changed:

   What|Removed |Added

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

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

[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-03-29 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96380

--- Comment #3 from Marek Polacek  ---
(In reply to Jakub Jelinek from comment #2)
> extern const int a, b;
> enum struct c;
> template 
> enum struct c : union enum struct c { e = b, f = a }; 
> enum class c {};
> 
> ICEs even without -fpermissive.
> 
> And
> extern const int a, b;
> enum struct c;
> template 
> enum struct c : union enum struct c { e = b, f = a }; 
> is accepted for some reason, even when for e.g.
> template 
> enum E : int { F };
> we reject it:
> error: template declaration of ‘enum E’
> 
> Marek, have you made any progress on this?

Not yet, sorry.  Hopefully this week then.

[Bug c++/99809] ICE: sorry, unimplemented: unexpected AST of kind nontype_argument_pack

2021-03-29 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99809

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #1 from Marek Polacek  ---
Confirmed, clang++ compiles it.  Reduced:

namespace std {
template  bool is_same_v;
namespace __detail {
template  concept __same_as = is_same_v<_Up>;
}
template 
concept same_as = __detail::__same_as<_Up, _Tp>;
} // namespace std
void f(auto... args) {
  [](std::same_as auto) {};
}
int main() { f(); }

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

2021-03-29 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

   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
 CC||mpolacek at gcc dot gnu.org
   Target Milestone|--- |10.3
Summary|ICE: in tsubst_copy, at |[10/11 Regression] ICE: in
   |cp/pt.c:17247   |tsubst_copy, at
   ||cp/pt.c:17247

--- Comment #1 from Marek Polacek  ---
Started with r272586, so mine.  GCC 9:

99806.C:2:34: error: expected primary-expression before ‘)’ token
2 | struct S { void f(auto) noexcept(); };
  |  ^

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

2021-03-29 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

 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2021-03-29

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

2021-03-29 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

   Target Milestone|--- |9.4
 CC||mpolacek at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
 Status|UNCONFIRMED |ASSIGNED
 Ever confirmed|0   |1
   Last reconfirmed||2021-03-29
   Priority|P3  |P2
Summary|ICE: in make_typename_type, |[9/10/11 Regression] ICE:
   |at cp/decl.c:4057   |in make_typename_type, at
   ||cp/decl.c:4057

--- Comment #1 from Marek Polacek  ---
And this one is mine too -- r266710.

[Bug c++/99815] [11 Regression] ICE: in placeholder_type_constraint_dependent_p, at cp/pt.c:28193

2021-03-29 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99815

Marek Polacek  changed:

   What|Removed |Added

   Last reconfirmed||2021-03-29
   Priority|P3  |P1
   Target Milestone|--- |11.0
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
Summary|ICE: in |[11 Regression] ICE: in
   |placeholder_type_constraint |placeholder_type_constraint
   |_dependent_p, at|_dependent_p, at
   |cp/pt.c:28193   |cp/pt.c:28193
 CC||mpolacek at gcc dot gnu.org,
   ||ppalka at gcc dot gnu.org

--- Comment #1 from Marek Polacek  ---
Confirmed.  Started with r11-7540.

[Bug c++/99573] ICE in module: internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in start_enum, at cp/decl.c:15663

2021-03-29 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99573

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #1 from Marek Polacek  ---
Confirmed.  I hit this with another, simplified example:

// x.h
namespace std {
  enum class align_val_t: decltype(sizeof(int)) {};
}

// z.cc
export module A:base;
#include "x.h"

$ ./cc1plus -quiet z.cc -fmodules-ts
In file included from z.cc:2:
x.h:2:27: error: cannot define ‘enum class std::align_val_t’ in different
module
2 |   enum class align_val_t: decltype(sizeof(int)) {};
  |   ^
: note: declared here
x.h:2:27: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in start_enum, at cp/decl.c:15699
0x1a18873 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
/home/mpolacek/src/gcc/gcc/tree.c:9866
0xa1e03c tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/home/mpolacek/src/gcc/gcc/tree.h:3476
0xb4d2e1 start_enum(tree_node*, tree_node*, tree_node*, tree_node*, bool,
bool*)
/home/mpolacek/src/gcc/gcc/cp/decl.c:15699
0xc9a49d cp_parser_enum_specifier
/home/mpolacek/src/gcc/gcc/cp/parser.c:19986
0xc9725b cp_parser_type_specifier
/home/mpolacek/src/gcc/gcc/cp/parser.c:18412
0xc91963 cp_parser_decl_specifier_seq
/home/mpolacek/src/gcc/gcc/cp/parser.c:15062
0xc90054 cp_parser_simple_declaration
/home/mpolacek/src/gcc/gcc/cp/parser.c:14319
0xc8ffdc cp_parser_block_declaration
/home/mpolacek/src/gcc/gcc/cp/parser.c:14266
0xc8fca8 cp_parser_declaration
/home/mpolacek/src/gcc/gcc/cp/parser.c:14137
0xc8fd9d cp_parser_toplevel_declaration
/home/mpolacek/src/gcc/gcc/cp/parser.c:14166
0xc8f53e cp_parser_declaration_seq_opt
/home/mpolacek/src/gcc/gcc/cp/parser.c:13954
0xc9b41c cp_parser_namespace_body
/home/mpolacek/src/gcc/gcc/cp/parser.c:20454
0xc9b3c5 cp_parser_namespace_definition
/home/mpolacek/src/gcc/gcc/cp/parser.c:20432
0xc8fb8d cp_parser_declaration
/home/mpolacek/src/gcc/gcc/cp/parser.c:14117
0xc8fd9d cp_parser_toplevel_declaration
/home/mpolacek/src/gcc/gcc/cp/parser.c:14166
0xc7b6e5 cp_parser_translation_unit
/home/mpolacek/src/gcc/gcc/cp/parser.c:4942
0xcde6f6 c_parse_file()
/home/mpolacek/src/gcc/gcc/cp/parser.c:45257
0xea11b4 c_common_parse_file()
/home/mpolacek/src/gcc/gcc/c-family/c-opts.c:1218

[Bug c++/99573] ICE in module: internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in start_enum, at cp/decl.c:15663

2021-03-29 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99573

Marek Polacek  changed:

   What|Removed |Added

   Keywords|ice-on-valid-code   |ice-on-invalid-code

--- Comment #2 from Marek Polacek  ---
Original test:

export module A:base;
#include 

[Bug c++/99734] [modules] ICE in most_specialized_instantiation

2021-03-29 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99734

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #3 from Marek Polacek  ---
All 4 work for me now.

$ xg++ -std=c++20 -fmodules-ts -x c++-system-header stdexcept -c
$ xg++ -std=c++20 -fmodules-ts -x c++-system-header filesystem -c
$ xg++ -std=c++20 -fmodules-ts -x c++-system-header future -c
$ xg++ -std=c++20 -fmodules-ts -x c++-system-header system_error -c

[Bug c++/99227] [meta] [modules] Bugs relating to header-units of STL header files

2021-03-29 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99227
Bug 99227 depends on bug 99734, which changed state.

Bug 99734 Summary: [modules] ICE in most_specialized_instantiation
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99734

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

[Bug c++/99735] [modules] in system headers: non-template type ‘rebind_alloc’ used as a template

2021-03-29 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99735

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #2 from Marek Polacek  ---
I can't reproduce this, can you?

[Bug c++/99479] [modules] ICE Aborted signal terminated program cc1plus

2021-03-29 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99479

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #7 from Marek Polacek  ---
Reproduced.  I see:

$ xg++ -std=c++20 -fmodules-ts -x c++-system-header future
In file included from
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/ios_base.h:41,
 from
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/ios:42,
 from
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/ostream:38,
 from
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/unique_ptr.h:42,
 from
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/shared_ptr_base.h:59,
 from
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/shared_ptr.h:53,
 from
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/condition_variable:43,
 from
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/future:39:
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/locale_classes.h:163:23:
internal compiler error: in install_entity, at cp/module.cc:7465
  163 | locale(const std::string& __s) : locale(__s.c_str()) { }
  |   ^~
0xc09df4 trees_in::install_entity(tree_node*)
/home/mpolacek/src/gcc/gcc/cp/module.cc:7465
0xc0c78e trees_in::decl_value()
/home/mpolacek/src/gcc/gcc/cp/module.cc:7977
0xc124b7 trees_in::tree_node(bool)
/home/mpolacek/src/gcc/gcc/cp/module.cc:9151
0xc2bdd1 module_state::read_cluster(unsigned int)
/home/mpolacek/src/gcc/gcc/cp/module.cc:14791
0xc35172 module_state::load_section(unsigned int, binding_slot*)
/home/mpolacek/src/gcc/gcc/cp/module.cc:18062
0xc37490 module_state::lazy_load(unsigned int, binding_slot*)
/home/mpolacek/src/gcc/gcc/cp/module.cc:18720
0xc149c3 trees_in::tree_node(bool)
/home/mpolacek/src/gcc/gcc/cp/module.cc:9662
0xc07feb trees_in::lang_decl_vals(tree_node*)
/home/mpolacek/src/gcc/gcc/cp/module.cc:6867
0xc086df trees_in::lang_vals(tree_node*)
/home/mpolacek/src/gcc/gcc/cp/module.cc:7029
0xc0882e trees_in::tree_node_vals(tree_node*)
/home/mpolacek/src/gcc/gcc/cp/module.cc:7060
0xc0c587 trees_in::decl_value()
/home/mpolacek/src/gcc/gcc/cp/module.cc:7939
0xc124b7 trees_in::tree_node(bool)
/home/mpolacek/src/gcc/gcc/cp/module.cc:9151
0xbffa8e trees_in::chained_decls()
/home/mpolacek/src/gcc/gcc/cp/module.cc:4839
0xc068dc trees_in::core_vals(tree_node*)
/home/mpolacek/src/gcc/gcc/cp/module.cc:6541
0xc08812 trees_in::tree_node_vals(tree_node*)
/home/mpolacek/src/gcc/gcc/cp/module.cc:7058
0xc118d4 trees_in::tree_value()
/home/mpolacek/src/gcc/gcc/cp/module.cc:8928
0xc1249f trees_in::tree_node(bool)
/home/mpolacek/src/gcc/gcc/cp/module.cc:9146
0xc068fb trees_in::core_vals(tree_node*)
/home/mpolacek/src/gcc/gcc/cp/module.cc:6543
0xc08812 trees_in::tree_node_vals(tree_node*)
/home/mpolacek/src/gcc/gcc/cp/module.cc:7058
0xc118d4 trees_in::tree_value()
/home/mpolacek/src/gcc/gcc/cp/module.cc:8928

[Bug c++/99482] [modules] ICE tree check: expected tree_vec, have addr_expr in lookup_template_class_1, at cp/pt.c:9803

2021-03-29 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99482

Marek Polacek  changed:

   What|Removed |Added

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

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

[Bug c++/99227] [meta] [modules] Bugs relating to header-units of STL header files

2021-03-29 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99227
Bug 99227 depends on bug 99482, which changed state.

Bug 99482 Summary: [modules] ICE tree check: expected tree_vec, have addr_expr 
in lookup_template_class_1, at cp/pt.c:9803
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99482

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |FIXED

[Bug c++/99483] [modules] ICE tree check: expected tree_vec, have bind_expr in lookup_template_class_1, at cp/pt.c:9803

2021-03-29 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99483

Marek Polacek  changed:

   What|Removed |Added

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

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

[Bug c++/99227] [meta] [modules] Bugs relating to header-units of STL header files

2021-03-29 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99227
Bug 99227 depends on bug 99483, which changed state.

Bug 99483 Summary: [modules] ICE tree check: expected tree_vec, have bind_expr 
in lookup_template_class_1, at cp/pt.c:9803
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99483

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |FIXED

[Bug c++/99769] [modules] internal compiler error: in tree_node, at cp/module.cc:9105 when compile module partitions

2021-03-29 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99769

Marek Polacek  changed:

   What|Removed |Added

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

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

[Bug c++/99769] [modules] internal compiler error: in tree_node, at cp/module.cc:9105 when compile module partitions

2021-03-29 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99769

--- Comment #2 from Marek Polacek  ---
We have __dynamic_cast without DECL_CONTEXT and so ICE in

 9050   if (!DECL_CONTEXT (t))
 9051 {
 9052   /* There are a few cases of decls with no context.  We'll write
 9053  these by value, but first assert they are cases we expect. 
*/
 9054   gcc_checking_assert (ref == WK_normal);
 9055   switch (TREE_CODE (t))
 9056 {
 9057 default: gcc_unreachable ();

[Bug c++/99684] [modules] std::visit fails to compile when is used as header unit

2021-03-29 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99684

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #1 from Marek Polacek  ---
Reproduced.  The error is:

/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/variant:966:29:
error: static assertion failed: std::visit requires the visitor to have the
same return type for all alternatives of a variant
  966 |   static_assert(is_same_v<_Tp, decltype(__tmp_element)>,
  | ^~~

[Bug c++/99427] [modules] in system headers: non-constant condition for static assertion

2021-03-29 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99427

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org
   Last reconfirmed||2021-03-30
 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED

[Bug c++/99426] [modules] failed to read compiled module cluster 1186: Bad file data

2021-03-29 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99426

Marek Polacek  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2021-03-30
 CC||mpolacek at gcc dot gnu.org

[Bug c++/99424] [modules] ICE tree check: expected tree_vec, have error_mark in lookup_template_class_1, at cp/pt.c:9803

2021-03-29 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99424

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #3 from Marek Polacek  ---
Assuming fixed.

[Bug c++/99227] [meta] [modules] Bugs relating to header-units of STL header files

2021-03-29 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99227
Bug 99227 depends on bug 99424, which changed state.

Bug 99424 Summary: [modules] ICE tree check: expected tree_vec, have error_mark 
in lookup_template_class_1, at cp/pt.c:9803
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99424

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |FIXED

[Bug debug/99654] Incorrect DW_AT_entry_pc values for inlined function

2021-03-30 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99654

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #5 from Marek Polacek  ---
Confirmed then.

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

2021-03-30 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

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

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

Breakpoint 1, fancy_abort (file=0x283d618
"/home/mpolacek/src/gcc/gcc/cp/decl.c", line=6720, 
function=0x28403ca "reshape_init") at
/home/mpolacek/src/gcc/gcc/diagnostic.c:1884
1884  if (global_dc->printer == NULL)
(gdb) up
#1  0x00b284fd in reshape_init (type=, 
init=, complain=3) at
/home/mpolacek/src/gcc/gcc/cp/decl.c:6720
6720  gcc_assert (BRACE_ENCLOSED_INITIALIZER_P (init));
(gdb) p init
$1 = 

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

2021-03-30 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

   Keywords||needs-reduction

--- Comment #3 from Marek Polacek  ---
Trying to reduce (--param ggc-min-heapsize=100 --param ggc-min-expand=10 seems
to help), but it'll take time.

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

2021-03-30 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

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

--- Comment #2 from Marek Polacek  ---
Still present, just hit this with

template  void forward() {
  concept C = true;
}

Let me take a look then...

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

2021-03-30 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

   Keywords|needs-reduction |

--- Comment #5 from Marek Polacek  ---
And here's a reduced version of there original test.  Will try to reduce
further.

template  struct remove_cv { using type = int; };
template  using __remove_cvref_t = typename remove_cv<_Tp>::type;
template  using remove_cvref_t = __remove_cvref_t<_Tp>;
template 
concept derived_from = __is_base_of(_Base, _Derived);
template  struct iterator_traits;
struct input_iterator_tag;
namespace __detail {
template  struct __iter_traits_impl {
  using type = iterator_traits;
};
template 
using __iter_traits = typename __iter_traits_impl<_Iter>::type;
template 
using __iter_diff_t = typename __iter_traits<_Tp>::difference_type;
} // namespace __detail
template 
using iter_difference_t = __detail::__iter_diff_t>;
namespace __detail {
template  struct __iter_concept_impl;
template  requires requires { typename _Iter; }
struct __iter_concept_impl<_Iter> {
  using type = typename __iter_traits<_Iter>::iterator_concept;
};
template 
using __iter_concept = typename __iter_concept_impl<_Iter>::type;
} // namespace __detail
template  concept weakly_incrementable = requires(_Iter __i) {
  __i;
};
template 
concept input_iterator =
derived_from<__detail::__iter_concept<_Iter>, input_iterator_tag>;
template  struct iterator_traits {
  using iterator_concept = input_iterator_tag;
  using difference_type = int;
};
template  struct in_out_result {};
template  using copy_n_result = in_out_result<_Out>;
struct {
  template 
  constexpr copy_n_result<_Iter, _Out>
  operator()(_Iter __first, iter_difference_t<_Iter> __n, _Out __result) {
for (; __n; --__n, ++__result)
  *__result = *__first;
return {};
  }
} copy_n;
template  struct StringLiteral {
  constexpr StringLiteral(const char (&str)[N]) { copy_n(str, N, value); }
  char value[N];
};
template  struct string {
  constexpr bool operator==(const string &) const = default;
};
template  void operator+(string) {
  char value[1];
  StringLiteral{value};
}
static_assert(string<"hello, world">{} == string<"hello"
 ", world">{});
static_assert(string<"a rose is a rose is a rose">{} == string<"a rose"
   " is "
   "a rose"
   " is "
   "a rose">{});

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

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

--- Comment #6 from Marek Polacek  ---
Even shorter:

// PR c++/99831

template  struct S {
  constexpr S(const char (&str)[N]) : value{} { }
  char value[N];
};
template  struct string {
  constexpr bool operator==(const string &) const = default;
};
template  void operator+(string) {
  char value[1];
  S{value};
}
static_assert(string<"a">{} == string<"a">{});

  1   2   3   4   5   6   7   8   9   10   >