Skip to content

dllimport conflicts with exclude_from_explicit_instantiation. #40363

@llvmbot

Description

@llvmbot
Bugzilla Link 41018
Version trunk
OS All
Reporter LLVM Bugzilla Contributor
CC @DougGregor,@zmodem,@ldionne,@nico,@zygoloid,@rnk

Extended Description

When both dllimport and exclude_from_explicit_instantiation are passed, Clang still expects the function to have a externally available definition. But this is not the case.

For example: https://godbolt.org/z/gKOHCk

This leads to linker errors because of undefined symbols.

I think one approach would be to make Clang not inherit dllimport attributes on functions declared with exclude_from_explicit_instantiation. When dllimport is applied directly, we could emit an error for incompatible attributes.

Metadata

Metadata

Assignees

Labels

bugzillaIssues migrated from bugzillac++clang:codegenIR generation bugs: mangling, exceptions, etc.confirmedVerified by a second party

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions