public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/68074] New: [C++14] Complex ConstExpr Evaluation
@ 2015-10-24 1:44 arbmind at gmail dot com
2015-10-24 1:55 ` [Bug c++/68074] " arbmind at gmail dot com
0 siblings, 1 reply; 2+ messages in thread
From: arbmind at gmail dot com @ 2015-10-24 1:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68074
Bug ID: 68074
Summary: [C++14] Complex ConstExpr Evaluation
Product: gcc
Version: 5.2.0
URL: http://goo.gl/T7h3Qg
Status: UNCONFIRMED
Keywords: rejects-valid, wrong-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: arbmind at gmail dot com
Target Milestone: ---
Please take a look at my constexpr experiment.
http://goo.gl/T7h3Qg
GCC 5.2.0 and 5.1.0 has multiple issues with this code.
It compiles well in all variants on Clang 3.7 and 3.8 snapshots.
The goal of the experiment is to implement a multiplication table at compile
time. Peter Sommerlad showed it on CppCon 2015. Video
https://www.youtube.com/watch?v=DM-RXeiSCmc
This implementation makes much more use of constexpr features of C++14.
The issues are marked with comment in the code.
1. Currently the code compiles, but prints the strings backwards. Generating
the strings at runtime, does not schod this behavior. Clang gets this right as
well.
2. The auto generated copy & move operators of carray do behave different. In
compile time execution only the first element is handled. Using the class at
runtime works well. Clang does the same during compile time.
3. Adding an exception to the string generation triggers a strange compiler
error. "sorry, unimplemented: unexpected AST of kind loop_expr" Clang works
well.
4. GCC does not allow me to use range based for loops for carray. Clang has no
problem with that.
Thanks for all the good work. May my experiment help to improve g++.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/68074] [C++14] Complex ConstExpr Evaluation
2015-10-24 1:44 [Bug c++/68074] New: [C++14] Complex ConstExpr Evaluation arbmind at gmail dot com
@ 2015-10-24 1:55 ` arbmind at gmail dot com
0 siblings, 0 replies; 2+ messages in thread
From: arbmind at gmail dot com @ 2015-10-24 1:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68074
--- Comment #1 from Andreas Reischuck <arbmind at gmail dot com> ---
Fixed some issues in my example.
http://goo.gl/Rxq7TP
The ranged for loops now compile on clang. The problem is not the loop, but the
address calculation.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-24 1:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-24 1:44 [Bug c++/68074] New: [C++14] Complex ConstExpr Evaluation arbmind at gmail dot com
2015-10-24 1:55 ` [Bug c++/68074] " arbmind at gmail dot com
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).