[Bug c++/71116] Lambdas should not be literal types

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon May 16 23:25:00 GMT 2016


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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
   Last reconfirmed|                            |2016-5-16
                 CC|                            |msebor at gcc dot gnu.org
         Resolution|---                         |DUPLICATE
      Known to fail|                            |4.9.3, 5.3.0, 6.1.0, 7.0

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed with all supported versions of GCC as well as today's trunk of 7.0. 
A slightly simplified test case independent of libstdc++:

$ cat uu.cpp && /home/msebor/build/gcc-fortify-source/gcc/xgcc
-B/home/msebor/build/gcc-fortify-source/gcc -S uu.cpp
void oops () {
  auto fn = []{ };
  static_assert (!__is_literal_type (decltype (fn)), "oops");
}


uu.cpp: In function ‘void oops()’:
uu.cpp:3:3: error: static assertion failed: oops
   static_assert (!__is_literal_type (decltype (fn)), "oops");
   ^~~~~~~~~~~~~

I think this needs to be fixed in tandem with bug 70979 and so is probably
simplest to treat it as a duplicate.

*** This bug has been marked as a duplicate of bug 70979 ***


More information about the Gcc-bugs mailing list