Skip to content

MSVC mangler in Clang fails with "cannot mangle this template type parameter type yet" #1715

Open
@etkramer

Description

@etkramer

Brief Description

When used on QtCore's "qhashfunctions.h", CppSharp 1.0.1 fails with the message:

(0,0): error: cannot mangle this template type parameter type yet
(0,0): error: cannot mangle this dependent name type yet

OS: Windows 11 22621 (64-bit)

Used headers

qhashfunctions.h from Qt 6.2.4 (msvc2019) or minimal sample:

#include <numeric>

template <typename T, typename = void>
constexpr inline bool HasQHashSingleArgOverload = false;

template <typename T>
constexpr inline bool HasQHashSingleArgOverload<T, std::enable_if_t<
	std::is_convertible_v<decltype(qHash(std::declval<const T &>())), size_t>
>> = true;

Used settings

Target: x86_64-pc-win32-msvc

Other settings

var options = driver.Options;
options.GeneratorKind = GeneratorKind.CSharp;

var parserOptions = driver.ParserOptions;
parserOptions.TargetTriple = "x86_64-pc-win32-msvc";
parserOptions.LanguageVersion = CppSharp.Parser.LanguageVersion.CPP17;

var module = options.AddModule("Qt");
module.IncludeDirs.Add(@"E:\Qt\6.2.4\msvc2019_64\include");
module.IncludeDirs.Add(@"E:\Qt\6.2.4\msvc2019_64\include\QtCore");
module.LibraryDirs.Add(@"E:\Qt\6.2.4\msvc2019_64\lib");

module.Libraries.Add("Qt6Core.lib");
module.Headers.Add("qhashfunctions.h");

Stack trace or incompilable generated code

Parsing libraries...
Parsed 'Qt6Core.lib'
Parsing code...
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 322)
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 322)
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 322)
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 322)
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 337)
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 337)
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 337)
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 337)
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 283)
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 399)
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 399)
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 402)
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 402)
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 402)
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 405)
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 405)
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 405)
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 405)
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 408)
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 408)
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 408)
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 411)
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 411)
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 411)
Unhandled declaration kind: CXXDeductionGuide
  E:\Qt\6.2.4\msvc2019_64\include\QtCore/qstringtokenizer.h (line 411)
Error parsing 'qhashfunctions.h'
(0,0): error: cannot mangle this template type parameter type yet
(0,0): error: cannot mangle this dependent name type yet
CppSharp has encountered an error while parsing code.

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