Skip to content

Can't build cling v1.2 due to wrong number of arguments to Parser #556

@thomasjm

Description

@thomasjm
  • Checked for duplicates

Describe the bug

I'm unable to compile Cling at release tag v1.2. I'm using the latest cling-llvm18 branch at root-project/llvm-project@156e947.

The problem is this new Parser(...) call, which passes 4 arguments instead of 3:

m_LookupHelper.reset(new LookupHelper(new Parser(PP, SemaRef,
/*SkipFunctionBodies*/false,
/*isTemp*/true), this));

which produces a build error like this:

cling-unwrapped> /build/source/cling-source/lib/Interpreter/Interpreter.cpp:270:47: error: no matching constructor for initialization of 'Parser'                                                                                                                                         
cling-unwrapped>   270 |     m_LookupHelper.reset(new LookupHelper(new Parser(PP, SemaRef,                                                                                                                                                                                                
cling-unwrapped>       |                                               ^      ~~~~~~~~~~~~                                                                                                                                                                                                
cling-unwrapped>   271 |                                                      /*SkipFunctionBodies*/false,                                                                                                                                                                                
cling-unwrapped>       |                                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                                                                
cling-unwrapped>   272 |                                                      /*isTemp*/true), this));                                                                                                                                                                                    
cling-unwrapped>       |                                                      ~~~~~~~~~~~~~~                                                                                                                                                                                              
cling-unwrapped> /build/source/llvm/../clang/include/clang/Parse/Parser.h:463:3: note: candidate constructor not viable: requires 3 arguments, but 4 were provided

I'm unable to find a version of LLVM where this Parser constructor has 4 arguments, so I'm not sure how this ever worked.

It seems to be fixed by a later commit in master: cd4d1d8. If I backport that commit to v1.2, it builds.

Additional context

I'm using the approach described in "Building Cling Along with LLVM" in the README.

You can see exactly how I'm building this (as part of Nixpkgs) here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions