summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-12-14 06:54:03 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-12-14 06:54:03 +0000
commit26444c5243496953fa572bc0169f2ab006b1122a (patch)
tree21636cf906e9af81fa6b59b11404d7121360bc54 /clang/lib/Sema/SemaDecl.cpp
parent6fada2ddbdfecde74d0515723a1a0caacbdd3445 (diff)
downloadbcm5719-llvm-26444c5243496953fa572bc0169f2ab006b1122a.tar.gz
bcm5719-llvm-26444c5243496953fa572bc0169f2ab006b1122a.zip
Have Sema::ActOnStartOfFunctionDef return the declaration that was passed it.
This fixes the missing warning here: struct S { template <typename T> void meth() { char arr[3]; arr[4] = 0; // warning: array index 4 is past the end of the array } }; template <typename T> void func() { char arr[3]; arr[4] = 0; // no warning } llvm-svn: 170180
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index b4f77988bd6..cae0cfaf4c9 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -7945,7 +7945,7 @@ Decl *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Decl *D) {
diag::err_attribute_can_be_applied_only_to_symbol_declaration)
<< "dllimport";
FD->setInvalidDecl();
- return FD;
+ return D;
}
// Visual C++ appears to not think this is an issue, so only issue
@@ -7962,7 +7962,7 @@ Decl *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Decl *D) {
// We want to attach documentation to original Decl (which might be
// a function template).
ActOnDocumentableDecl(D);
- return FD;
+ return D;
}
/// \brief Given the set of return statements within a function body,
OpenPOWER on IntegriCloud