public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/103403] New: Decltype of rvalue reference
@ 2021-11-24  9:38 enricomaria.dean6elis at gmail dot com
  2021-11-24  9:50 ` [Bug c++/103403] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: enricomaria.dean6elis at gmail dot com @ 2021-11-24  9:38 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103403
           Summary: Decltype of rvalue reference
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: enricomaria.dean6elis at gmail dot com
                CC: anders.granlund.0 at gmail dot com,
                    daniel.kruegler at googlemail dot com, jason at gcc dot gnu.org,
                    mpolacek at gcc dot gnu.org, trippels at gcc dot gnu.org,
                    webrown.cpp at gmail dot com
  Target Milestone: ---

Unlike the comment at the end of the original report claims, the bug seems to
be still present (or at least a different shade of it).

StackOverflow question:
https://stackoverflow.com/questions/70092776/validity-of-presenting-an-xvalue-as-an-lvalue
Repro: https://godbolt.org/z/h943G933a


+++ This bug was initially created as a clone of Bug #78209 +++

This came up on the isocpp mailing list yesterday:

markus@x4 /tmp % cat test.ii
int main() {
  int &&i = 0;
  decltype(auto) j = i;
  return j;
}

markus@x4 /tmp % clang++ test.ii
test.ii:3:18: error: rvalue reference to type 'int' cannot bind to lvalue of
type 'int'
  decltype(auto) j = i;
                 ^   ~
1 error generated.

markus@x4 /tmp % icpc test.ii
test.ii(3): error: an rvalue reference cannot be bound to an lvalue
    decltype(auto) j = i;
                       ^
compilation aborted for test.ii (code 2)

markus@x4 /tmp % g++ -Wall -Wextra test.ii
markus@x4 /tmp %

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

end of thread, other threads:[~2023-03-07 17:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-24  9:38 [Bug c++/103403] New: Decltype of rvalue reference enricomaria.dean6elis at gmail dot com
2021-11-24  9:50 ` [Bug c++/103403] " pinskia at gcc dot gnu.org
2021-11-24  9:59 ` [Bug c++/103403] [11/12 Regression] auto return type with a trailing return type of decl(auto) uses rvalue reference type instead of reference type pinskia at gcc dot gnu.org
2021-11-24 10:09 ` rguenth at gcc dot gnu.org
2021-11-24 14:37 ` mpolacek at gcc dot gnu.org
2021-11-24 15:07 ` enricomaria.dean6elis at gmail dot com
2021-12-03 19:00 ` cvs-commit at gcc dot gnu.org
2021-12-03 19:01 ` [Bug c++/103403] [11 " mpolacek at gcc dot gnu.org
2022-04-21  7:50 ` rguenth at gcc dot gnu.org
2023-03-07 17:46 ` mpolacek 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).