-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Use init rather than ms extension syntax #55475
Conversation
With decltype, it apparently didn't clear head/tail or re-instantiated the list which was corrupting crossgen2. I have added a debug-only init method to simplify things. |
@am11 would doing a placement new + decltype work instead of adding the Init method? Something like the following: new (&ig->igBlocks) decltype(ig->igBlocks)(emitComp->getAllocator(CMK_LoopOpt))
|
f3f14dd
to
8e60c0d
Compare
Indeed, it is much cleaner. I was too pressed on making explicit ctor work with decltype, didn't thought of other (size_t) ctros. :) |
Looks like MSVC didn't resolve the correct type with decltype (it is resolving the type of Allocator rather than list<T,Allocator>). |
Reverted to init approach for now, which makes all compilers happy. :) |
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.
init
shouldn't really be under DEBUG
, but that's fine for now.
Sorry for the trouble...
Fixes gcc build.
Clang also gives the error as gcc when calling ctor function explicitly, but clang emits warning with
-fms-extensions
:gcc just does not support this extension (even with
-fms-extensions
). So lets fix it by rewriting it in ISO C++ syntax.cc @BruceForstall, @janvorli