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

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).