https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88815
Bug 88815 depends on bug 78244, which changed state.
Bug 78244 Summary: Narrowing conversion is accepted in a function template, but
it should be rejected
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78244
What|Removed
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88815
Marek Polacek changed:
What|Removed |Added
Status|ASSIGNED|RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88815
--- Comment #11 from Marek Polacek ---
Author: mpolacek
Date: Sun Jan 27 20:19:41 2019
New Revision: 268321
URL: https://gcc.gnu.org/viewcvs?rev=268321=gcc=rev
Log:
PR c++/88815 - narrowing conversion lost in decltype.
PR
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88815
Marek Polacek changed:
What|Removed |Added
Status|NEW |ASSIGNED
Assignee|unassigned
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88815
--- Comment #9 from Marek Polacek ---
(In reply to Marek Polacek from comment #4)
> So one idea would to be to walk_tree on the expression at the end of
> finish_decltype_type, looking for compound literals and call check_narrowing.
Scratch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88815
--- Comment #8 from Marek Polacek ---
That is most likely a bug in the package. GCC 8 wasn't very good at detecting
narrow conversions, but in GCC 9 things have improved, so probably we just
detect invalid code now. The problem in this PR is
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88815
Jeffrey A. Law changed:
What|Removed |Added
CC||law at redhat dot com
--- Comment #7
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88815
--- Comment #6 from Marek Polacek ---
And of course r265789 changed int{(p(), 0U)} from being dependent to being
non-dependent, so scenario 2) to scenario 1).
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88815
--- Comment #5 from Marek Polacek ---
(My proof-of-concept patch to deal with narrowing in decltype fixed this PR as
a result.)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88815
--- Comment #4 from Marek Polacek ---
There can be three scenarios:
1) decltype is in a template and it has no dependent expressions -- PROBLEM
- we call finish_compound_literal from cp_parser_functional_cast
- processing_template_decl is 1, so
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88815
Marek Polacek changed:
What|Removed |Added
CC||mpolacek at gcc dot gnu.org
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88815
--- Comment #2 from Jakub Jelinek ---
I believe it is the
@@ -25361,7 +25486,10 @@
return NULL_TREE;
case TEMPLATE_PARM_INDEX:
- return *tp;
+ if (dependent_type_p (TREE_TYPE (*tp)))
+ return *tp;
+ /* We'll
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88815
Jakub Jelinek changed:
What|Removed |Added
Priority|P3 |P1
Status|UNCONFIRMED
13 matches
Mail list logo