public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/48872] New: [C++0x][noexcept] Placement-new problem with non-empty arguments
@ 2011-05-04 15:35 daniel.kruegler at googlemail dot com
  2011-05-04 17:44 ` [Bug c++/48872] " daniel.kruegler at googlemail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2011-05-04 15:35 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48872

           Summary: [C++0x][noexcept] Placement-new problem with non-empty
                    arguments
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: daniel.kruegler@googlemail.com
                CC: jason@redhat.com


gcc 4.7.0 20110430 (experimental) in C++0x mode rejects the following program:

//--------------
#include <new>

struct U {};

template<class T>
T&& create();

const bool b = noexcept(::new (((void*) 0)) U(create<U&&>()));
static_assert(b, "Ouch"); // #

int main() {}
//--------------

At the line marked with # the static_assert fires. The same problem occurs, if
the initializer of U is e.g. create<U&>() or create<const U&>(), but a program
with an empty initializer like

const bool b = noexcept(::new (((void*) 0)) U());

is accepted. In either case no operation which potentially throws an exception
is called, therefore the program should be accepted.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-05-05 15:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-04 15:35 [Bug c++/48872] New: [C++0x][noexcept] Placement-new problem with non-empty arguments daniel.kruegler at googlemail dot com
2011-05-04 17:44 ` [Bug c++/48872] " daniel.kruegler at googlemail dot com
2011-05-04 17:54 ` paolo.carlini at oracle dot com
2011-05-04 18:15 ` daniel.kruegler at googlemail dot com
2011-05-04 18:44 ` paolo.carlini at oracle dot com
2011-05-05  7:20 ` daniel.kruegler at googlemail dot com
2011-05-05 15:40 ` jason 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).