public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/60271] [C++1y] std::max(initializer_list<T>) cannot use std::max_element
[not found] <bug-60271-4@http.gcc.gnu.org/bugzilla/>
@ 2014-02-20 14:36 ` glisse at gcc dot gnu.org
2014-02-20 14:44 ` redi at gcc dot gnu.org
` (10 subsequent siblings)
11 siblings, 0 replies; 12+ messages in thread
From: glisse at gcc dot gnu.org @ 2014-02-20 14:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60271
--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> ---
In my opinion, the sensible thing to do is add constexpr to max_element (and
the __ops helpers) once the front-end supports it, not duplicate the code in
max(initializer_list). Well, since max_element is just one line calling
__max_element, there isn't that much code duplicated, but on the principle...
Did you file an LWG issue about this?
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/60271] [C++1y] std::max(initializer_list<T>) cannot use std::max_element
[not found] <bug-60271-4@http.gcc.gnu.org/bugzilla/>
2014-02-20 14:36 ` [Bug libstdc++/60271] [C++1y] std::max(initializer_list<T>) cannot use std::max_element glisse at gcc dot gnu.org
@ 2014-02-20 14:44 ` redi at gcc dot gnu.org
2014-02-20 15:00 ` redi at gcc dot gnu.org
` (9 subsequent siblings)
11 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2014-02-20 14:44 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60271
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The same thought occurred to me, but I didn't file an issue.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/60271] [C++1y] std::max(initializer_list<T>) cannot use std::max_element
[not found] <bug-60271-4@http.gcc.gnu.org/bugzilla/>
2014-02-20 14:36 ` [Bug libstdc++/60271] [C++1y] std::max(initializer_list<T>) cannot use std::max_element glisse at gcc dot gnu.org
2014-02-20 14:44 ` redi at gcc dot gnu.org
@ 2014-02-20 15:00 ` redi at gcc dot gnu.org
2014-02-20 16:29 ` glisse at gcc dot gnu.org
` (8 subsequent siblings)
11 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2014-02-20 15:00 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60271
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Even if max_element() isn't made constexpr, we can make __max_element constexpr
(once the FE supports it) and use it directly in max.
It's certainly solvable, I just wanted to create this PR so we don't forget
about it.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/60271] [C++1y] std::max(initializer_list<T>) cannot use std::max_element
[not found] <bug-60271-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2014-02-20 15:00 ` redi at gcc dot gnu.org
@ 2014-02-20 16:29 ` glisse at gcc dot gnu.org
2014-02-20 18:16 ` redi at gcc dot gnu.org
` (7 subsequent siblings)
11 siblings, 0 replies; 12+ messages in thread
From: glisse at gcc dot gnu.org @ 2014-02-20 16:29 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60271
--- Comment #4 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #2)
> The same thought occurred to me, but I didn't file an issue.
Should I do it, or are you going to?
(In reply to Jonathan Wakely from comment #3)
> It's certainly solvable, I just wanted to create this PR so we don't forget
> about it.
That's how I took it, thanks :-)
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/60271] [C++1y] std::max(initializer_list<T>) cannot use std::max_element
[not found] <bug-60271-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2014-02-20 16:29 ` glisse at gcc dot gnu.org
@ 2014-02-20 18:16 ` redi at gcc dot gnu.org
2014-12-21 10:09 ` redi at gcc dot gnu.org
` (6 subsequent siblings)
11 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2014-02-20 18:16 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60271
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Marc Glisse from comment #4)
> (In reply to Jonathan Wakely from comment #2)
> > The same thought occurred to me, but I didn't file an issue.
>
> Should I do it, or are you going to?
Please go ahead, I might not get a chance until next week now!
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/60271] [C++1y] std::max(initializer_list<T>) cannot use std::max_element
[not found] <bug-60271-4@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2014-02-20 18:16 ` redi at gcc dot gnu.org
@ 2014-12-21 10:09 ` redi at gcc dot gnu.org
2014-12-22 15:02 ` redi at gcc dot gnu.org
` (5 subsequent siblings)
11 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2014-12-21 10:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60271
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2014-12-21
Target Milestone|--- |5.0
Ever confirmed|0 |1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/60271] [C++1y] std::max(initializer_list<T>) cannot use std::max_element
[not found] <bug-60271-4@http.gcc.gnu.org/bugzilla/>
` (5 preceding siblings ...)
2014-12-21 10:09 ` redi at gcc dot gnu.org
@ 2014-12-22 15:02 ` redi at gcc dot gnu.org
2014-12-22 16:01 ` redi at gcc dot gnu.org
` (4 subsequent siblings)
11 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2014-12-22 15:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60271
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
http://cplusplus.github.io/LWG/lwg-active.html#2369
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/60271] [C++1y] std::max(initializer_list<T>) cannot use std::max_element
[not found] <bug-60271-4@http.gcc.gnu.org/bugzilla/>
` (6 preceding siblings ...)
2014-12-22 15:02 ` redi at gcc dot gnu.org
@ 2014-12-22 16:01 ` redi at gcc dot gnu.org
2014-12-22 16:43 ` [Bug libstdc++/60271] [DR2369] " redi at gcc dot gnu.org
` (3 subsequent siblings)
11 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2014-12-22 16:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60271
--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Mon Dec 22 16:00:16 2014
New Revision: 219015
URL: https://gcc.gnu.org/viewcvs?rev=219015&root=gcc&view=rev
Log:
2014-12-22 Ville Voutilainen <ville.voutilainen@gmail.com>
PR libstdc++/60271
C++14 constexpr min, max, minmax, min_element, max_element
and minmax_element. Also constexpr for 20.9.5-20.9.9,
aka various library functors.
* include/bits/c++config: Add _GLIBCXX14_CONSTEXPR.
* include/bits/algorithmfwd.h (min, max, minmax, min_element,
max_element): Use it.
* include/bits/predefined_ops.h (_Iter_less_iter, __iter_less_iter,
_Iter_comp_iter, __iter_comp_iter): Likewise.
* include/bits/stl_algo.h (minmax, __minmax_element, minmax_element,
min, max, __min_element, min_element, __max_element, max_element)
Likewise.
* include/bits/stl_algobase.h (min, max): Likewise.
* include/bits/stl_function.h (plus, minus, multiplies, divides,
modulus, negate, equal_to, not_equal_to, greater, less, greater_equal,
less_equal, logical_and, logical_or, logical_not, bit_and, bit_or,
bit_xor, bit_not, unary_negate, not1, binary_negate, not2): Likewise.
* testsuite/20_util/function_objects/constexpr.cc: New.
* testsuite/25_algorithms/max/constexpr.cc: Likewise.
* testsuite/25_algorithms/max_element/constexpr.cc: Likewise.
* testsuite/25_algorithms/min/constexpr.cc: Likewise.
* testsuite/25_algorithms/min_element/constexpr.cc: Likewise.
* testsuite/25_algorithms/minmax/constexpr.cc: Likewise.
* testsuite/25_algorithms/minmax_element/constexpr.cc: Likewise.
* testsuite/ext/profile/mutex_extensions_neg.cc: Adjust dg-error.
Added:
trunk/libstdc++-v3/testsuite/20_util/function_objects/constexpr.cc
trunk/libstdc++-v3/testsuite/25_algorithms/max/constexpr.cc
- copied, changed from r219014,
trunk/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc
trunk/libstdc++-v3/testsuite/25_algorithms/max_element/constexpr.cc
- copied, changed from r219014,
trunk/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc
trunk/libstdc++-v3/testsuite/25_algorithms/min/constexpr.cc
- copied, changed from r219014,
trunk/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc
trunk/libstdc++-v3/testsuite/25_algorithms/min_element/constexpr.cc
- copied, changed from r219014,
trunk/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc
trunk/libstdc++-v3/testsuite/25_algorithms/minmax/constexpr.cc
- copied, changed from r219014,
trunk/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc
trunk/libstdc++-v3/testsuite/25_algorithms/minmax_element/constexpr.cc
- copied, changed from r219014,
trunk/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/bits/algorithmfwd.h
trunk/libstdc++-v3/include/bits/c++config
trunk/libstdc++-v3/include/bits/predefined_ops.h
trunk/libstdc++-v3/include/bits/stl_algo.h
trunk/libstdc++-v3/include/bits/stl_algobase.h
trunk/libstdc++-v3/include/bits/stl_function.h
trunk/libstdc++-v3/testsuite/ext/profile/mutex_extensions_neg.cc
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/60271] [DR2369] [C++1y] std::max(initializer_list<T>) cannot use std::max_element
[not found] <bug-60271-4@http.gcc.gnu.org/bugzilla/>
` (7 preceding siblings ...)
2014-12-22 16:01 ` redi at gcc dot gnu.org
@ 2014-12-22 16:43 ` redi at gcc dot gnu.org
2015-04-22 12:01 ` jakub at gcc dot gnu.org
` (2 subsequent siblings)
11 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2014-12-22 16:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60271
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |SUSPENDED
Summary|[C++1y] |[DR2369] [C++1y]
|std::max(initializer_list<T |std::max(initializer_list<T
|>) cannot use |>) cannot use
|std::max_element |std::max_element
--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Suspending until the DR is resolved.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/60271] [DR2369] [C++1y] std::max(initializer_list<T>) cannot use std::max_element
[not found] <bug-60271-4@http.gcc.gnu.org/bugzilla/>
` (8 preceding siblings ...)
2014-12-22 16:43 ` [Bug libstdc++/60271] [DR2369] " redi at gcc dot gnu.org
@ 2015-04-22 12:01 ` jakub at gcc dot gnu.org
2015-07-16 9:17 ` rguenth at gcc dot gnu.org
2015-09-02 11:13 ` redi at gcc dot gnu.org
11 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-04-22 12:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60271
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|5.0 |5.2
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 5.1 has been released.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/60271] [DR2369] [C++1y] std::max(initializer_list<T>) cannot use std::max_element
[not found] <bug-60271-4@http.gcc.gnu.org/bugzilla/>
` (9 preceding siblings ...)
2015-04-22 12:01 ` jakub at gcc dot gnu.org
@ 2015-07-16 9:17 ` rguenth at gcc dot gnu.org
2015-09-02 11:13 ` redi at gcc dot gnu.org
11 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-07-16 9:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60271
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|5.2 |5.3
--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 5.2 is being released, adjusting target milestone to 5.3.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libstdc++/60271] [DR2369] [C++1y] std::max(initializer_list<T>) cannot use std::max_element
[not found] <bug-60271-4@http.gcc.gnu.org/bugzilla/>
` (10 preceding siblings ...)
2015-07-16 9:17 ` rguenth at gcc dot gnu.org
@ 2015-09-02 11:13 ` redi at gcc dot gnu.org
11 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2015-09-02 11:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60271
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|SUSPENDED |RESOLVED
Resolution|--- |FIXED
Target Milestone|5.3 |5.0
--- Comment #11 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The issue is resolved and the code was fixed for 5.1
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2015-09-02 11:13 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-60271-4@http.gcc.gnu.org/bugzilla/>
2014-02-20 14:36 ` [Bug libstdc++/60271] [C++1y] std::max(initializer_list<T>) cannot use std::max_element glisse at gcc dot gnu.org
2014-02-20 14:44 ` redi at gcc dot gnu.org
2014-02-20 15:00 ` redi at gcc dot gnu.org
2014-02-20 16:29 ` glisse at gcc dot gnu.org
2014-02-20 18:16 ` redi at gcc dot gnu.org
2014-12-21 10:09 ` redi at gcc dot gnu.org
2014-12-22 15:02 ` redi at gcc dot gnu.org
2014-12-22 16:01 ` redi at gcc dot gnu.org
2014-12-22 16:43 ` [Bug libstdc++/60271] [DR2369] " redi at gcc dot gnu.org
2015-04-22 12:01 ` jakub at gcc dot gnu.org
2015-07-16 9:17 ` rguenth at gcc dot gnu.org
2015-09-02 11:13 ` redi at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).