let Documentation = [Undocumented];
}
-def OMPDeclareVariant : Attr {
+def OMPDeclareVariant : InheritableAttr {
let Spellings = [Pragma<"omp", "declare variant">];
let Subjects = SubjectList<[Function]>;
let SemaHandler = 0;
let HasCustomParsing = 1;
+ let InheritEvenIfAlreadyPresent = 1;
let Documentation = [OMPDeclareVariantDocs];
let Args = [
ExprArgument<"VariantFuncRef">,
// CHECK-NEXT: #pragma omp declare variant(SpecialFuncs::bar) match(implementation={vendor(llvm)})
// CHECK-NEXT: void foo1() {
// CHECK-NEXT: }
+// CHECK-NEXT: #pragma omp declare variant(SpecialFuncs::baz) match(implementation={vendor(unknown)})
+// CHECK-NEXT: void xxx();
// CHECK-NEXT: } s;
struct SpecialFuncs {
void vd() {}
#pragma omp declare variant(SpecialFuncs::bar) match(implementation={vendor(ibm)}, implementation={vendor(llvm)})
#pragma omp declare variant(SpecialFuncs::baz) match(implementation={vendor(unknown)})
void foo1() {}
+#pragma omp declare variant(SpecialFuncs::baz) match(implementation={vendor(unknown)})
+ void xxx();
} s;
+// CHECK: #pragma omp declare variant(SpecialFuncs::baz) match(implementation={vendor(unknown)})
+// CHECK-NEXT: void SpecialFuncs::xxx() {
+// CHECK-NEXT: }
+void SpecialFuncs::xxx() {}
+
// CHECK: static void static_f_variant() {
// CHECK-NEXT: }
static void static_f_variant() {}