- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone!
I got this issue when compiling my code, and I have minimized it into a several-line demonstration:
struct Obj { Obj() = default; Obj( const Obj& ) = default; Obj& operator=( const Obj&) = default; ~Obj() = default; // <-- delete this fun and everything works. but how?? }; template <typename Type> class TestType { public: void foo( Type valueToCompare ) {} }; int main() { TestType<Obj> obj; obj.foo( Obj() ); return 1; }
This would cause a "error : access violation void foo( Type valueToCompare ) {}" during compiling. And if you remove the default destructor specification, the error would mysteriously disappear.
I'm using ICC 2015 update 4.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi mengke,
I cannot reproduce the issue.
Could you please provide more information? You are using Windows right? What is the VS version? Is there any special options setup?
I've tested it on Linux with 2015 U3 and 2016 initial release, on windows with 2015 U4 (get other issues with VS2015, but that is known issues) and 2016 initial release in VS2015.
Thanks,
Shenghong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>>>This would cause a "error : access violation void foo( Type valueToCompare ) {}" during compiling. And if you remove the default destructor specification, the error would mysteriously disappear.>>>
I have also seen similar errors stating "access violation" when compiler stopped and was not able to compile the code. Fixing the code would help usually in my case.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page