diff options
| author | 2020-11-02 13:43:50 -0800 | |
|---|---|---|
| committer | 2020-11-03 09:12:16 -0800 | |
| commit | d08b1e404f319c52257c9d8df3b934876a43be21 (patch) | |
| tree | f12ec611f4f22bda207f2be0a5ca1d3835929d39 /libs | |
| parent | 1111ce4a0d84521cc26c0e7f2dd3033b3dd4276b (diff) | |
Make ScopedFileDescriptor default ctor implicit
Having the default ctor marked explicit causes problems initializing
it using the {} syntax, which occurs, e.g. in
binder_parcel_utils.h:483
Without this change, compilation fails with:
"chosen constructor is explicit in copy-initialization"
Test: compiles
Change-Id: Ic261a3d9ce4bbd7d3d54402ccdcc4d4e02add271
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/binder/ndk/include_cpp/android/binder_auto_utils.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/binder/ndk/include_cpp/android/binder_auto_utils.h b/libs/binder/ndk/include_cpp/android/binder_auto_utils.h index 18877af32a..8d60226725 100644 --- a/libs/binder/ndk/include_cpp/android/binder_auto_utils.h +++ b/libs/binder/ndk/include_cpp/android/binder_auto_utils.h @@ -313,7 +313,8 @@ class ScopedFileDescriptor : public impl::ScopedAResource<int, int, close, -1> { /** * Takes ownership of a. */ - explicit ScopedFileDescriptor(int a = -1) : ScopedAResource(a) {} + ScopedFileDescriptor() : ScopedFileDescriptor(-1) {} + explicit ScopedFileDescriptor(int a) : ScopedAResource(a) {} ~ScopedFileDescriptor() {} ScopedFileDescriptor(ScopedFileDescriptor&&) = default; ScopedFileDescriptor& operator=(ScopedFileDescriptor&&) = default; |