This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/66160] New: gcc-5.1.0 fails with "lambda-expression in unevaluated context" where gcc-4.9.2 succeeds


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

            Bug ID: 66160
           Summary: gcc-5.1.0 fails with "lambda-expression in unevaluated
                    context" where gcc-4.9.2 succeeds
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tgard at opentext dot com
  Target Milestone: ---

gcc-5.1.0 fails with "lambda-expression in unevaluated context" where gcc-4.9.2
succeeds

c++ -std=c++11 -c bug.cxx -o bug.o
bug.cxx:12:63: error: lambda-expression in unevaluated context
   typedef typename std::remove_reference<decltype( (StringT())[0] )>::type
CharT;
                                                               ^
bug.cxx:
#include <string>
typedef wchar_t CharT;
typedef std::string String;
template <class StringT = String>
struct Example
{
        struct ExampleProxy
        {
                typedef typename std::remove_reference<decltype( (StringT())[0]
)>::type CharT;
        };
};

g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/local/gcc-5.1.0/libexec/gcc/x86_64-unknown-linux-gnu/5.1.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /builds/gbgbuild/bld/gcc/gcc-5.1.0/configure
--prefix=/usr/local/gcc-5.1.0 --enable-languages=c,c++ --enable-threads
--enable-libsanitizer=no
Thread model: posix
gcc version 5.1.0 (GCC)

It seems possible the second of the patches here is incorrect:
https://gcc.gnu.org/ml/gcc-patches/2014-03/msg01362.html


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]