[LLVMbugs] [Bug 23824] New: clang allows invalid lambda expression in decltype

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jun 11 21:38:00 PDT 2015


            Bug ID: 23824
           Summary: clang allows invalid lambda expression in decltype
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++14
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ryan.burn at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following invalid code compiles with clang (-std=c++14).

#include <type_traits>

template<class T>
constexpr int f() {
  using Func = decltype(
    [](auto x) { return x; }
  return 0;

int main() {
  std::integral_constant<int, f<int>()> x;
  return 0;

Both gcc and EDG reject it.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150612/322bf710/attachment.html>

More information about the llvm-bugs mailing list