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++/65075] New: [5 Regression] constexpr regression


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

            Bug ID: 65075
           Summary: [5 Regression] constexpr regression
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org

typedef void (*E) ();
template <class T>
constexpr E
bar ()
{
  return []() {};
}
void
foo ()
{
  (bar<int> ()) ();
}

is rejected since r215954 aka PR55250 with -std=c++11:
error: body of constexpr function âconstexpr void (* bar())() [with T = int; E
= void (*)()]â not a return-statement
The body is a return statement, just perhaps with some extra artificial
statements created for the lambda.

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