Skip to content

Wrapping CPP with static[int] generates wrong code #7477

@dom96

Description

@dom96
type
  SmallString* {.importcpp: "llvm::SmallString", header: "llvm/ADT/SmallString.h", noDecl.} [N: static[int]] = object

var x: SmallString[128]

Compiled with: nim cpp --passC:"-I/usr/local/opt/llvm/include" --passC:"-std=c++11" file

Error:

/private/tmp/aporia/nimcache/a4.cpp:24:27: error: template argument for non-type template parameter must be an expression
typedef llvm::SmallString<NI>  TY_7XJAavvgqEKfZ9bvblIL8mw;
                          ^~
/usr/local/opt/llvm/include/llvm/ADT/SmallString.h:25:19: note: template parameter is declared here
template<unsigned InternalLen>
                  ^
1 error generated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions