aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/AST/Attr.h2
-rw-r--r--include/clang/AST/Decl.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/include/clang/AST/Attr.h b/include/clang/AST/Attr.h
index ae2c25b11b..c3390a021a 100644
--- a/include/clang/AST/Attr.h
+++ b/include/clang/AST/Attr.h
@@ -14,7 +14,7 @@
#ifndef LLVM_CLANG_AST_ATTR_H
#define LLVM_CLANG_AST_ATTR_H
-#include <assert.h>
+#include <cassert>
namespace clang {
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h
index 0fbf0f9285..bf8a214eb1 100644
--- a/include/clang/AST/Decl.h
+++ b/include/clang/AST/Decl.h
@@ -140,8 +140,8 @@ public:
template<typename T> T *getAttr() {
for (Attr *attr = getAttrs(); attr; attr = attr->getNext())
- if (isa<T>(attr))
- return cast<T>(attr);
+ if (T *V = dyn_cast<T>(attr))
+ return V;
return 0;
}