I have: pgc++ 16.10-0 64-bit target on Apple OS/X -tp haswell
With the code below, I see
% pgc++ -std=c++11 -c p.cpp
“p.cpp”, line 9: error: no instance of overloaded function “std::make_shared”
matches the argument list
argument types are: (size_t)
std::shared_ptr<std::vector > q = std::make_shared<std::vector >(size());
Additionally, if you explicitly cast n to size_t in the “p =” statement, you get the same error. The problem goes away if passing a size_t variable, i.e. “p =” and “r =” below.
The problem is not seen with
pgc++ 16.10-0 64-bit target on x86-64 Linux -tp haswell
#include
#include
#include
size_t size();
void x() {
std::size_t n=2;
std::shared_ptr<std::vector > p = std::make_shared<std::vector >(n);
std::shared_ptr<std::vector > q = std::make_shared<std::vector >(size());
std::shared_ptr<std::vector > r = std::make_shared<std::vector >((n=size()));
std::vector* s = new std::vector(size());
}