public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101213] New: Improve support for decltype(std)
@ 2021-06-25 16:37 llvm at rifkin dot dev
  2021-06-25 16:54 ` [Bug c++/101213] " redi at gcc dot gnu.org
  2021-06-25 17:53 ` llvm at rifkin dot dev
  0 siblings, 2 replies; 3+ messages in thread
From: llvm at rifkin dot dev @ 2021-06-25 16:37 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101213
           Summary: Improve support for decltype(std)
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: llvm at rifkin dot dev
  Target Milestone: ---

Gcc treats decltype(std) as an integer. It only works in some situations
though:

// OK
decltype(std) a;
static_assert(std::is_same<int, decltype(a)>::value);

// Not OK
static_assert(std::is_same<int, decltype(std)>::value);

// OK
decltype(std) a;
using b = decltype(a);
using c = b;

// Not OK
using a = decltype(std);
using b = a;

decltype(std) foo(int a) {} // OK
auto foo() -> decltype(std) {} // OK
void foo(decltype(std) a) {} // Not OK

// Not OK
std::vector<decltype(std)> v;

This bug is hilarious please improve support for it and make it a feature :)
It's invaluable for code bowling and nerd sniping.

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

end of thread, other threads:[~2021-06-25 17:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-25 16:37 [Bug c++/101213] New: Improve support for decltype(std) llvm at rifkin dot dev
2021-06-25 16:54 ` [Bug c++/101213] " redi at gcc dot gnu.org
2021-06-25 17:53 ` llvm at rifkin dot dev

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