* [Bug c++/100161] [10/11/12 Regression] Impossible to suppress Wtype-limits warning involving template parameter.
2021-04-20 18:50 [Bug c++/100161] New: Impossible to suppress Wtype-limits warning involving template parameter yyc1992 at gmail dot com
@ 2021-04-20 19:06 ` mpolacek at gcc dot gnu.org
2021-04-20 19:10 ` jakub at gcc dot gnu.org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-04-20 19:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100161
Marek Polacek <mpolacek at gcc dot gnu.org> 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 <mpolacek at gcc dot gnu.org> ---
Started with my r11-155.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/100161] [10/11/12 Regression] Impossible to suppress Wtype-limits warning involving template parameter.
2021-04-20 18:50 [Bug c++/100161] New: Impossible to suppress Wtype-limits warning involving template parameter yyc1992 at gmail dot com
2021-04-20 19:06 ` [Bug c++/100161] [10/11/12 Regression] " mpolacek at gcc dot gnu.org
@ 2021-04-20 19:10 ` jakub at gcc dot gnu.org
2021-04-22 21:37 ` cvs-commit at gcc dot gnu.org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-04-20 19:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100161
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Which has been backported to 10 branch in
r10-8120-ge5613c55c2900cd23c9e78592f10258e19c74ab3
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/100161] [10/11/12 Regression] Impossible to suppress Wtype-limits warning involving template parameter.
2021-04-20 18:50 [Bug c++/100161] New: Impossible to suppress Wtype-limits warning involving template parameter yyc1992 at gmail dot com
2021-04-20 19:06 ` [Bug c++/100161] [10/11/12 Regression] " mpolacek at gcc dot gnu.org
2021-04-20 19:10 ` jakub at gcc dot gnu.org
@ 2021-04-22 21:37 ` cvs-commit at gcc dot gnu.org
2021-04-22 21:38 ` [Bug c++/100161] [10/11 " mpolacek at gcc dot gnu.org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-22 21:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100161
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:244dfb95119106e9267f37583caac565c39eb0ec
commit r12-71-g244dfb95119106e9267f37583caac565c39eb0ec
Author: Marek Polacek <polacek@redhat.com>
Date: Tue Apr 20 20:24:09 2021 -0400
c++: Prevent bogus -Wtype-limits warning with NTTP [PR100161]
Recently, we made sure that we never call value_dependent_expression_p
on an expression that isn't potential_constant_expression. That caused
this bogus warning with a non-type template parameter, something that
users don't want to see.
The problem is that in tsubst_copy_and_build/LE_EXPR 't' is "i < n",
which, due to 'i', is not p_c_e, therefore we call t_d_e_p. But the
type of 'n' isn't dependent, so we think the whole 't' expression is
not dependent. It seems we need to test both op0 and op1 separately
to suppress this warning.
gcc/cp/ChangeLog:
PR c++/100161
* pt.c (tsubst_copy_and_build) <case PLUS_EXPR>: Test op0 and
op1 separately for value- or type-dependence.
gcc/testsuite/ChangeLog:
PR c++/100161
* g++.dg/warn/Wtype-limits6.C: New test.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/100161] [10/11 Regression] Impossible to suppress Wtype-limits warning involving template parameter.
2021-04-20 18:50 [Bug c++/100161] New: Impossible to suppress Wtype-limits warning involving template parameter yyc1992 at gmail dot com
` (2 preceding siblings ...)
2021-04-22 21:37 ` cvs-commit at gcc dot gnu.org
@ 2021-04-22 21:38 ` mpolacek at gcc dot gnu.org
2021-04-27 16:41 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-04-22 21:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100161
Marek Polacek <mpolacek at gcc dot gnu.org> 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 <mpolacek at gcc dot gnu.org> ---
Fixed on trunk so far.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/100161] [10/11 Regression] Impossible to suppress Wtype-limits warning involving template parameter.
2021-04-20 18:50 [Bug c++/100161] New: Impossible to suppress Wtype-limits warning involving template parameter yyc1992 at gmail dot com
` (3 preceding siblings ...)
2021-04-22 21:38 ` [Bug c++/100161] [10/11 " mpolacek at gcc dot gnu.org
@ 2021-04-27 16:41 ` cvs-commit at gcc dot gnu.org
2021-05-31 10:40 ` [Bug c++/100161] [10 " marxin at gcc dot gnu.org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-27 16:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100161
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Marek Polacek
<mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:fb7c736c2f17ad054ee7815b688fa91135690f6d
commit r11-8306-gfb7c736c2f17ad054ee7815b688fa91135690f6d
Author: Marek Polacek <polacek@redhat.com>
Date: Tue Apr 20 20:24:09 2021 -0400
c++: Prevent bogus -Wtype-limits warning with NTTP [PR100161]
Recently, we made sure that we never call value_dependent_expression_p
on an expression that isn't potential_constant_expression. That caused
this bogus warning with a non-type template parameter, something that
users don't want to see.
The problem is that in tsubst_copy_and_build/LE_EXPR 't' is "i < n",
which, due to 'i', is not p_c_e, therefore we call t_d_e_p. But the
type of 'n' isn't dependent, so we think the whole 't' expression is
not dependent. It seems we need to test both op0 and op1 separately
to suppress this warning.
gcc/cp/ChangeLog:
PR c++/100161
* pt.c (tsubst_copy_and_build) <case PLUS_EXPR>: Test op0 and
op1 separately for value- or type-dependence.
gcc/testsuite/ChangeLog:
PR c++/100161
* g++.dg/warn/Wtype-limits6.C: New test.
(cherry picked from commit 244dfb95119106e9267f37583caac565c39eb0ec)
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/100161] [10 Regression] Impossible to suppress Wtype-limits warning involving template parameter
2021-04-20 18:50 [Bug c++/100161] New: Impossible to suppress Wtype-limits warning involving template parameter yyc1992 at gmail dot com
` (4 preceding siblings ...)
2021-04-27 16:41 ` cvs-commit at gcc dot gnu.org
@ 2021-05-31 10:40 ` marxin at gcc dot gnu.org
2021-09-13 11:09 ` marxin at gcc dot gnu.org
2021-12-02 13:29 ` mpolacek at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-05-31 10:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100161
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pdimov at gmail dot com
--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
*** Bug 100827 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/100161] [10 Regression] Impossible to suppress Wtype-limits warning involving template parameter
2021-04-20 18:50 [Bug c++/100161] New: Impossible to suppress Wtype-limits warning involving template parameter yyc1992 at gmail dot com
` (5 preceding siblings ...)
2021-05-31 10:40 ` [Bug c++/100161] [10 " marxin at gcc dot gnu.org
@ 2021-09-13 11:09 ` marxin at gcc dot gnu.org
2021-12-02 13:29 ` mpolacek at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-09-13 11:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100161
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |andysem at mail dot ru
--- Comment #7 from Martin Liška <marxin at gcc dot gnu.org> ---
*** Bug 102293 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/100161] [10 Regression] Impossible to suppress Wtype-limits warning involving template parameter
2021-04-20 18:50 [Bug c++/100161] New: Impossible to suppress Wtype-limits warning involving template parameter yyc1992 at gmail dot com
` (6 preceding siblings ...)
2021-09-13 11:09 ` marxin at gcc dot gnu.org
@ 2021-12-02 13:29 ` mpolacek at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-12-02 13:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100161
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #8 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed in 11+.
^ permalink raw reply [flat|nested] 9+ messages in thread