CompilationResult: remove private default ctor
The private default constructor was added to force users to call one of
CompilationResult's static member functions to construct a
CompilationResult. However, it was possible to bypass this restriction
using aggregate initialization:
CompilationResult do_compile(...) {
...
CompilationResult result; // ill-formed, calls private ctor
CompilationResult result {}; // OK, uses aggregate initialization
CompilationResult result { .elapsed_time_ms = 42 }; // also OK
...
}
In C++20, the user-declared private default constructor now prevents
aggregate initialization, which closes the loophole. See
https://wg21.link/p1008r1.
Remove the private constructor so that CompilationResult's members can
still use the elegant aggregate syntax themselves.
Bug: 311052584
Test: remove cpp_std override and build Android
Test: atest art_standalone_odrefresh_tests
Change-Id: I3ecb8bec5fb69d453d82fff7235caf417c9f1a8c
1 file changed