diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-06-15 03:23:34 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-06-15 03:23:34 +0000 |
commit | 1454cb952b76a7dc441f2ae1b7f8d998a54a23cf (patch) | |
tree | 0950caeb5bf5acd9b624d6e14b99e068fdab20d6 /lib/Sema/JumpDiagnostics.cpp | |
parent | cf739927f9b00c801867f620b04b79e3259c311f (diff) |
Properly implement C++0x [stmt.dcl]p3, which requires a scope to be
protected in the case where a variable is being initialized by a
trivial default constructor but has a non-trivial destructor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133037 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/JumpDiagnostics.cpp')
-rw-r--r-- | lib/Sema/JumpDiagnostics.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/JumpDiagnostics.cpp b/lib/Sema/JumpDiagnostics.cpp index ae154aae20..679f4fefa2 100644 --- a/lib/Sema/JumpDiagnostics.cpp +++ b/lib/Sema/JumpDiagnostics.cpp @@ -157,6 +157,9 @@ static std::pair<unsigned,unsigned> : Record->isPOD()) && Constructor->isDefaultConstructor()) CallsTrivialConstructor = true; + + if (CallsTrivialConstructor && !Record->hasTrivialDestructor()) + InDiag = diag::note_protected_by_variable_nontriv_destructor; } if (!CallsTrivialConstructor) |