public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/48324] New: [C++0x] constexpr evaluation should respect lifetime rules
@ 2011-03-29 3:15 jason at gcc dot gnu.org
2011-05-23 18:33 ` [Bug c++/48324] " jason at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-29 3:15 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48324
Summary: [C++0x] constexpr evaluation should respect lifetime
rules
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: jason@gcc.gnu.org
// { dg-options -std=c++0x }
struct S {
const int val;
constexpr S(int i) : val(i) { }
};
constexpr const int& to_ref(int i) {
return S(i).val;
}
constexpr int ary[to_ref(98)] = { }; // { dg-error "use of dead temporary" }
int main() { }
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/48324] [C++0x] constexpr evaluation should respect lifetime rules
2011-03-29 3:15 [Bug c++/48324] New: [C++0x] constexpr evaluation should respect lifetime rules jason at gcc dot gnu.org
@ 2011-05-23 18:33 ` jason at gcc dot gnu.org
2015-03-20 16:58 ` paolo.carlini at oracle dot com
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-23 18:33 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48324
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.05.23 17:53:51
Ever Confirmed|0 |1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/48324] [C++0x] constexpr evaluation should respect lifetime rules
2011-03-29 3:15 [Bug c++/48324] New: [C++0x] constexpr evaluation should respect lifetime rules jason at gcc dot gnu.org
2011-05-23 18:33 ` [Bug c++/48324] " jason at gcc dot gnu.org
@ 2015-03-20 16:58 ` paolo.carlini at oracle dot com
2015-03-20 17:44 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-03-20 16:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48324
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |paolo.carlini at oracle dot com
--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
I suppose we can close this as fixed: we warn about returning a reference to a
temporary at line 9 and then we error out at line 12 about the size not being
an integral constant expression. Likewise clang.
Jason, shall I add the testcase and close the bug?
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/48324] [C++0x] constexpr evaluation should respect lifetime rules
2011-03-29 3:15 [Bug c++/48324] New: [C++0x] constexpr evaluation should respect lifetime rules jason at gcc dot gnu.org
2011-05-23 18:33 ` [Bug c++/48324] " jason at gcc dot gnu.org
2015-03-20 16:58 ` paolo.carlini at oracle dot com
@ 2015-03-20 17:44 ` jason at gcc dot gnu.org
2015-03-20 17:57 ` paolo at gcc dot gnu.org
2015-03-20 17:59 ` paolo.carlini at oracle dot com
4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2015-03-20 17:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48324
--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
Please.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/48324] [C++0x] constexpr evaluation should respect lifetime rules
2011-03-29 3:15 [Bug c++/48324] New: [C++0x] constexpr evaluation should respect lifetime rules jason at gcc dot gnu.org
` (2 preceding siblings ...)
2015-03-20 17:44 ` jason at gcc dot gnu.org
@ 2015-03-20 17:57 ` paolo at gcc dot gnu.org
2015-03-20 17:59 ` paolo.carlini at oracle dot com
4 siblings, 0 replies; 6+ messages in thread
From: paolo at gcc dot gnu.org @ 2015-03-20 17:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48324
--- Comment #3 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Fri Mar 20 17:26:32 2015
New Revision: 221539
URL: https://gcc.gnu.org/viewcvs?rev=221539&root=gcc&view=rev
Log:
2015-03-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/48324
* g++.dg/cpp0x/constexpr-48324.C: New.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-48324.C
Modified:
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/48324] [C++0x] constexpr evaluation should respect lifetime rules
2011-03-29 3:15 [Bug c++/48324] New: [C++0x] constexpr evaluation should respect lifetime rules jason at gcc dot gnu.org
` (3 preceding siblings ...)
2015-03-20 17:57 ` paolo at gcc dot gnu.org
@ 2015-03-20 17:59 ` paolo.carlini at oracle dot com
4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-03-20 17:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48324
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
Target Milestone|--- |5.0
--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Done.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-03-20 17:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-29 3:15 [Bug c++/48324] New: [C++0x] constexpr evaluation should respect lifetime rules jason at gcc dot gnu.org
2011-05-23 18:33 ` [Bug c++/48324] " jason at gcc dot gnu.org
2015-03-20 16:58 ` paolo.carlini at oracle dot com
2015-03-20 17:44 ` jason at gcc dot gnu.org
2015-03-20 17:57 ` paolo at gcc dot gnu.org
2015-03-20 17:59 ` paolo.carlini at oracle 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).