-
Notifications
You must be signed in to change notification settings - Fork 93
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
fix constructor order, friend class, inconsistent function, inconsistent class/struct #1725
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great catch, I would have thought that -Wreorder
can catch some of these issues, and I must have missed the name mangling capturing parameter const-ness.
083b66d
to
9e53640
Compare
I found the const-ness issue by lucky. I do not have an idea that any tool can help detecting this situation. |
8a73658
to
0a10d23
Compare
|
…nstructor order This fixes constructor order, friend class, inconsistent function, inconsistent class/struct It fixes the build issue from clang-cl on Windows Related PR: ginkgo-project#1725
From #1675 , we can not use clang-cl on windows to build ginkgo (maybe only static build, not sure the shared build)
The reason is the inconsistence between the declaration and declaration of definition.
For example,
We declare
void func(int *a);
, which is seen by ginkgo_core. We also use it to instantiate the function.However, we implement it like
void func(int *const a) {...}
.The symbol in the library from clang-cl will use
void func(int *const a)
notvoid func(int *a)
.core only know
void func(int *a)
such that it can not find the symbol properly although theint* a
should be fit intoint* const a
More than that, I also fix the constructor order is different from the data member order, microsoft does not like the friend class without namespace not in the nearest namespace, and inconsistent class/struct.
also, add some tricks to avoid alais undeclared in the a structure which is in another tempalted structure.
It is mentioned in llvm/llvm-project#64996
we use
using .. = ..
in the nested struct as workaround here