Skip to content
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

[r19c] error: no matching constructor for initialization of 'std::shared_ptr<uint8_t []>' #950

Closed
SravanaLakshmiSunkara opened this issue Apr 2, 2019 · 7 comments

Comments

@SravanaLakshmiSunkara
Copy link

SravanaLakshmiSunkara commented Apr 2, 2019

Description
I am trying to use std::shared_ptr <uint8_t []> in my NDK application, but compiler throws below error.

error: no matching constructor for initialization of 'std::shared_ptr<uint8_t []>'

std::shared_ptr<uint8_t[]> x_data(new uint8_t[bytes_to_send]);

The CMake looks like below

cmake {
        version "3.10.2"
        cppFlags "-std=c++17 -stdlib=libc++ -frtti -fexceptions"
        .....
}

Environment Details
NDK Version: r19c (19.2.5345600)
Build sytem: any
Compiler: clang++
ABI: any
STL: libc++
NDK API level: 21
Device API level: n/a

@alexcohn
Copy link

alexcohn commented Apr 2, 2019

https://wandbox.org/ shows that this compiles for gcc 7.1.0 and higher, but fails on any clang

@DanAlbert
Copy link
Member

Seems this is a C++17 feature, and not one that libc++ supports yet.

@rprichard
Copy link
Collaborator

Seems this is a C++17 feature, and not one that libc++ supports yet.

Yeah, that seems to be the case. This StackOverflow link looks relevant: https://stackoverflow.com/questions/13061979/shared-ptr-to-an-array-should-it-be-used

@andrei-datcu
Copy link

@DanAlbert libc++ added support in https://reviews.llvm.org/rGce195fb22b542c20745e3ed46d1516e8b4e3a76f (v11)
However, ndk master build still misses the patch. Any idea when are we going to see this picked up? Thanks!

@DanAlbert
Copy link
Member

No timeline. Upstream redid how testing works so we have to redo all our infrastructure again. It's the next thing on my list but I have no idea how long it will take.

@glebm
Copy link

glebm commented Aug 20, 2023

Still an issue in 2023, NDK version 25.2.9519653.

@glebm
Copy link

glebm commented Aug 20, 2023

For anyone landing here from Google, looks like libc++ is finally updated in NDK 26 (according to #1530). NDK 26 is scheduled for release in September according to https://github.com/android/ndk/wiki#ndk-r26-lts

@android android locked as resolved and limited conversation to collaborators Aug 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants