break;
}
+ case attr::EnableIf: {
+ const auto *From = cast<EnableIfAttr>(FromAttr);
+ AI.importAttr(From, AI.importArg(From->getCond()).value(),
+ From->getMessage());
+ break;
+ }
+
case attr::AssertCapability: {
const auto *From = cast<AssertCapabilityAttr>(FromAttr);
AI.importAttr(From,
EXPECT_EQ(FromAttr->getType()->getName(), ToAttr->getType()->getName());
}
+TEST_P(ImportAttributes, ImportEnableIf) {
+ EnableIfAttr *FromAttr, *ToAttr;
+ importAttr<FunctionDecl>(
+ "void test(int A) __attribute__((enable_if(A == 1, \"message\")));",
+ FromAttr, ToAttr);
+ checkImported(FromAttr->getCond(), ToAttr->getCond());
+ EXPECT_EQ(FromAttr->getMessage(), ToAttr->getMessage());
+}
+
TEST_P(ImportAttributes, ImportGuardedVar) {
GuardedVarAttr *FromAttr, *ToAttr;
importAttr<VarDecl>("int test __attribute__((guarded_var));", FromAttr,