[PATCH] D49511: [Sema/Attribute] Check for noderef attribute

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 14 12:48:02 PDT 2018


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

A few more minor nits to be cleared up, but otherwise LGTM. You should wait for @rsmith to sign off before committing in case he has further comments, however.



================
Comment at: lib/Sema/SemaExpr.cpp:4165
+bool Sema::TypeHasNoDeref(QualType Ty) {
+  // Strip off everything but attributes
+  QualType OldTy;
----------------
Missing a full stop at the end of the comment.


================
Comment at: lib/Sema/SemaExpr.cpp:4167
+  QualType OldTy;
+  while (Ty != OldTy && Ty->getTypeClass() != Type::Attributed) {
+    OldTy = Ty;
----------------
I'd prefer to use `!isa<AttributedType>(Ty)`; I think that's more clear than looking at the enumeration.


================
Comment at: test/Frontend/noderef.c:153
+
+  // Parenthesis
+  (((*((p))))); // expected-warning{{dereferencing p; was declared with a 'noderef' type}}
----------------
Typo: Parentheses


Repository:
  rC Clang

https://reviews.llvm.org/D49511





More information about the cfe-commits mailing list