Mapping issue

Below C++ code does build with the appropriate offloading flags, but errors
at run time. I am wondering if the mapping is done correctly.
Tested with the trunk Clang on POWER8.

#include
#include

class ConnectorBase {
public:
virtual int f() = 0;
//virtual void push_back() =0;
//virtual void copy_to_array() = 0;
//virtual void send() =0;
};

template
class Connector : public ConnectorBase {
private:
std::vector v_;
ConnectionT connArray[100];

public:
int f() { return 1; }
Connector& push_back(ConnectionT conn) {
v_.push_back(conn);
return *this;
}
void copy_to_array() {
std::copy(v_.begin(), v_.end(), connArray);
}
void send(int i, ConnectionT conn) {
int tmp=0;
while (true) {
ConnectionT conn_local = connArray[tmp];
//if (conn_local.is_disabled()) break;
if (tmp==10) break;
tmp++;
}
}
};

class SynIdDelay {
public:
bool is_disabled() const { return true; };
};

template
class Connection {
public:
int get_w() { return 1; }
bool is_disabled() const {
return syn_id_delay_.is_disabled();
}
protected:
SynIdDelay syn_id_delay_;
};

class Target {
};
int main()
{
int sum=0;
Connection connection;

ConnectorBase *connector = new Connector<Connection>();
Connector<Connection> *vc = static_cast<Connector<Connection> *>(connector);
connector = &vc->push_back(connection);
vc->copy_to_array();
Connector<Connection> *c = static_cast<Connector<Connection > *>(connector);
#pragma omp target parallel for reduction(+: sum) map(to: connection) map(to: c)
for(int i=0; i<100; i++) {
c->send(i, connection); // works, accessing an element of an array.
}

}