Skip to content
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

Solves C7626 error when compiling with MSVC 2019 16.6+ #3512

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

Conversation

willyborn
Copy link
Contributor

@willyborn willyborn commented Oct 15, 2023

Solves error C7626 when compiling with MSVC 2019 16.6+

Description

See Microsoft C7626 description.

unnamed typedef classes can generate linkage problems. Starting from MSVC 2019 16.6+, error C7626 is generated when compiling with /std:c++17 or above.
Solution: give the typedef a name (I chose KParam_t)

PS: The linkage problem also exists with GCC and Clang (see P1766R1.)

Changes to Users

None

Checklist

  • Rebased on latest master
  • Code compiles
  • Tests pass
  • Functions added to unified API
  • Functions documented

@ytian-xxxxxxxx
Copy link

It seems the typedef grammar of KParam is not C++ style, after I change to the following code, the build succeeded.
struct KParam {
dim_t dims[4];
dim_t strides[4];
dim_t offset;

#ifndef OPENCL_VERSION
dim_t *dims_ptr() { return dims; }
dim_t *strides_ptr() { return strides; }
#endif
};

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.

None yet

2 participants