summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2014-08-12 21:05:04 +0000
committerRichard Trieu <rtrieu@google.com>2014-08-12 21:05:04 +0000
commit4834ad2609515295a5e4132711b1f8f263500892 (patch)
treef7e9aafdcd6526c72a82a541ee7532a652a89240 /clang/lib/Sema/SemaDecl.cpp
parentb9ec65cd4dccd9d4a4174b0ce1308e4c4af46a3f (diff)
downloadbcm5719-llvm-4834ad2609515295a5e4132711b1f8f263500892.tar.gz
bcm5719-llvm-4834ad2609515295a5e4132711b1f8f263500892.zip
Improve -Wuninitialized to catch const classes being used in their own copy
constructors. llvm-svn: 215471
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 53a647149a8..9c0be3e76fb 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -8276,6 +8276,15 @@ namespace {
void VisitObjCMessageExpr(ObjCMessageExpr *E) { return; }
+ void VisitCXXConstructExpr(CXXConstructExpr *E) {
+ if (E->getConstructor()->isCopyConstructor()) {
+ if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(E->getArg(0))) {
+ HandleDeclRefExpr(DRE);
+ }
+ }
+ Inherited::VisitCXXConstructExpr(E);
+ }
+
void HandleDeclRefExpr(DeclRefExpr *DRE) {
Decl* ReferenceDecl = DRE->getDecl();
if (OrigDecl != ReferenceDecl) return;
OpenPOWER on IntegriCloud