[PATCH] D37308: Interface class with uuid base record

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 8 07:16:31 PDT 2017


aaron.ballman added inline comments.


================
Comment at: lib/Sema/SemaDeclCXX.cpp:2385
+  return RD->isStruct() && RD->hasAttr<UuidAttr>() &&
+         RD->getName() == "IUnknown" &&
+         (RD->getAttr<UuidAttr>())->getGuid() ==
----------------
This should probably also ensure that the class is in the global namespace so we don't handle `foobar::IUnknown` improperly.


================
Comment at: lib/Sema/SemaDeclCXX.cpp:2386
+         RD->getName() == "IUnknown" &&
+         (RD->getAttr<UuidAttr>())->getGuid() ==
+             "00000000-0000-0000-C000-000000000046" &&
----------------
Can remove the spurious parens. Also, rather than call `hasAttr<>` followed by `getAttr<>` on the same thing, you should factor out the call to `getAttr<>`.


https://reviews.llvm.org/D37308





More information about the cfe-commits mailing list