Skip to content

[MRE] cant resolve static variable offset for templated class #629

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Vipul-Cariappa
Copy link
Collaborator

@Vipul-Cariappa Vipul-Cariappa commented Jun 13, 2025

This is a bug report.

template <typename T>
struct ClassWithStatic {
    static T const ref_value;
};
template <typename T>
T constexpr ClassWithStatic<T>::ref_value = 42;

ClassWithStatic<int> x;
Cpp::GetVariableOffset(x.ref_val); // FAILS

Will help fix a test in cppyy.

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@Vipul-Cariappa Vipul-Cariappa force-pushed the bug/templ-class-static-dm branch from 510222c to aa78f32 Compare June 13, 2025 14:02
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant