[PATCH] D26846: __uuidof() and declspec(uuid("...")) should be allowed on enumeration types
David Majnemer via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 18 07:37:57 PST 2016
majnemer added a comment.
Do we have a testcase where the declspec is applied to something inappropriate like an int?
================
Comment at: lib/Sema/SemaDeclAttr.cpp:4669-4673
+ if (!(isa<CXXRecordDecl>(D) || isa<EnumDecl>(D))) {
S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)
- << Attr.getName() << ExpectedClass;
+ << Attr.getName() << ExpectedEnumOrClass;
return;
}
----------------
I don't think you need this now that you've got this in Attr.td
================
Comment at: lib/Sema/SemaExprCXX.cpp:523
- const auto *RD = Ty->getAsCXXRecordDecl();
+ const auto *RD = Ty->getAsTagDecl();
if (!RD)
----------------
Please renamed `RD` to something more appropriate like `TD`.
Repository:
rL LLVM
https://reviews.llvm.org/D26846
More information about the cfe-commits
mailing list