Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-8357

Ill-formed code after lambda triggers assert

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.08/00
    • Component/s: Cling
    • Labels:
      None
    • Environment:

      Linux

    • Development:

      Description

      template <typename UnaryOperation>
      static int lambda_operation(UnaryOperation op);
       
      template <typename T>
      inline int templated_function() {
        lambda_operation([](int) -> int { return 3; });
        //something_wrong;
        return 0;
      }
       
      void t() {
         templated_function<int>();
      }

      triggers

      Processing t.cxx...
      In file included from input_line_9:1:
      t.cxx:7:3: error: use of undeclared identifier 'something_wrong'
        something_wrong;
        ^
      root.exe: interpreter/llvm/src/tools/clang/lib/AST/DeclCXX.cpp:996: clang::CXXMethodDecl* clang::CXXRecordDecl::getLambdaCallOperator() const: Assertion `!Calls.empty() && "Missing lambda call operator!"' failed.
      Aborted

        Attachments

          Activity

            People

            Assignee:
            axel Axel Naumann
            Reporter:
            axel Axel Naumann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: