compiler-generated Questions

2

Solved

The following code compiles in gcc 9.1 godbolt but not clang 8 godbolt: class A { protected: ~A() = default; }; class B final : public A { }; int main() { auto b = B{}; } Clang's error: &lt...

4

Solved

Say I'm writing an int wrapper and need to provide every single operator overload. Must the author list out every single one, or can it auto-generate any based on what the author has provided...
Keavy asked 28/9, 2015 at 6:26

1

(I just realized I first need to solve a much more basic issue with copying unions: When a union object is copied, is a member subobject created?. Please see that other question first.) The implic...
Cofferdam asked 8/12, 2019 at 2:6

2

Solved

Hei. I was reading Digi Traffic Accelerator's decompiled source (I think it is the best way to learn), until I got some non-understandable code! Please take a look: internal class ProxyFarm { p...
Idyllist asked 10/4, 2013 at 1:20

1

Solved

If you compile the following code: private async Task<int> M() { return await Task.FromResult(0); } And then decompile it (I used dotPeek) and examine the all-important MoveNext method, y...
Kelda asked 13/3, 2014 at 5:7

7

Solved

When I write a class Widget.java public class Widget { int data; String name; } will the compiler-generated constructor be public or default? public would be like public class Widget { int ...
Angiosperm asked 13/2, 2014 at 9:50

4

Solved

class Base { virtual void foo() = 0; //~Base(); <-- No destructor! }; Obviously, Base will be derived. So, does C++ says the compiler-generated destructor of Base must be virtual? Thanks!
Octavo asked 12/8, 2011 at 14:51

2

Solved

Given the following, why does the InvalidCastException get thrown? I can't see why it should be outside of a bug (this is in x86; x64 crashes with a 0xC0000005 in clrjit.dll). class Program { sta...
Luciferase asked 4/3, 2011 at 1:25
1

© 2022 - 2024 — McMap. All rights reserved.