Non-static member functions should not be emitted as a standalone
functions, this leads to compiler crash.
llvm-svn: 331206
static llvm::Optional<OMPDeclareTargetDeclAttr::MapTypeTy>
isDeclareTargetDeclaration(const ValueDecl *VD) {
+ if (const auto *MD = dyn_cast<CXXMethodDecl>(VD))
+ if (!MD->isStatic())
+ return llvm::None;
for (const Decl *D : VD->redecls()) {
if (!D->hasAttrs())
continue;
int baz4() { return 5; }
#pragma omp declare target
+struct S {
+ int a;
+ S(int a) : a(a) {}
+};
+
int foo() { return 0; }
int b = 15;
int d;
#pragma omp target map(tofrom \
: a, b)
{
+ S s(a);
static long aaa = 23;
a = foo() + bar() + b + c + d + aa + aaa;
}