public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/63437] New: [4.9/5 regression][C++14] Parenthesized "movable but not copyable" object doesn't compile in return statement
@ 2014-10-02  2:26 flast at flast dot jp
  2014-10-02  3:03 ` [Bug c++/63437] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: flast at flast dot jp @ 2014-10-02  2:26 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63437

            Bug ID: 63437
           Summary: [4.9/5 regression][C++14] Parenthesized "movable but
                    not copyable" object doesn't compile in return
                    statement
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: flast at flast dot jp

After GCC 4.9, parenthesized "movable but not copyable" object doesn't compile
in return statement under C++14 mode (C++11 mode does compile).
I'm not sure that the behavior was changed in C++14 spec; Clang seems compile
under both of C++11/14 mode.

example:
----
struct X // movable but not copyable
{
    X() = default;
    X(X &&) = default;

    X(const X &) = delete;
};

X non_parenthesized()
{
    X x;
    return x; // works
}

X parenthesized()
{
    X x;
    return (x); // error: use of deleted function 'X::X(const X&)'
}
----

Online compiler results:
- GCC 4.8.2
 - C++11 http://melpon.org/wandbox/permlink/lRR60fvDgKfqd0UZ
 - C++14 http://melpon.org/wandbox/permlink/BAdrBmEG3euQLnqv

- GCC 4.9.1
 - C++11 http://melpon.org/wandbox/permlink/XllfUNu0VV0mnYsu
 - C++14 http://melpon.org/wandbox/permlink/qm67F6vODyADgKvQ (fail)

- GCC 5.0 20141001
 - C++11 http://melpon.org/wandbox/permlink/21bPbcuXB7S87DUG
 - C++14 http://melpon.org/wandbox/permlink/da8AeqX7HrS17T2n (fail)

- Clang 3.5.0
 - C++11 http://melpon.org/wandbox/permlink/VqgnlKRTOBHd5IDt
 - C++14 http://melpon.org/wandbox/permlink/tAkgLiaD50nOMtEz


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

end of thread, other threads:[~2014-10-10 20:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-02  2:26 [Bug c++/63437] New: [4.9/5 regression][C++14] Parenthesized "movable but not copyable" object doesn't compile in return statement flast at flast dot jp
2014-10-02  3:03 ` [Bug c++/63437] " pinskia at gcc dot gnu.org
2014-10-02  7:40 ` flast at flast dot jp
2014-10-02  9:08 ` redi at gcc dot gnu.org
2014-10-09 18:05 ` jason at gcc dot gnu.org
2014-10-10 20:35 ` jason at gcc dot gnu.org
2014-10-10 20:38 ` 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).