diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-01-14 00:31:13 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-01-14 00:31:13 +0000 |
commit | 3806cf84dce82865ff786f837280441bdb59ead0 (patch) | |
tree | 114d9bc6afd9bc0aa5f84f84109c9b74f75cc9dd /include | |
parent | 5fe8dcb8d847c5a512fd3861942dac38317aa4d4 (diff) |
Sema: An extern declaration can't be a redeclaration of a parameter
In the following:
void f(int x) { extern int x; }
The second declaration of 'x' shouldn't be considered a redeclaration of
the parameter.
This is a different approach to r225780.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225875 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/AST/Decl.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index cdba3bda80..a39888f9e1 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -906,6 +906,11 @@ public: return false; } + /// \brief Similar to isLocalVarDecl but also includes parameters. + bool isLocalVarDeclOrParm() const { + return isLocalVarDecl() || getKind() == Decl::ParmVar; + } + /// isFunctionOrMethodVarDecl - Similar to isLocalVarDecl, but /// excludes variables declared in blocks. bool isFunctionOrMethodVarDecl() const { |