diff options
| author | Reid Kleckner <rnk@google.com> | 2019-10-30 14:38:11 -0700 | 
|---|---|---|
| committer | Reid Kleckner <rnk@google.com> | 2019-10-30 15:06:26 -0700 | 
| commit | 812bdb3c13210759341e8a1b08b864a539ce9dc7 (patch) | |
| tree | 8b4a7d2419a61b8ae88f7e1d512b17ba6845c706 /clang/lib | |
| parent | d9e0a2942ac71327166a3a597e8383192fd19b17 (diff) | |
| download | bcm5719-llvm-812bdb3c13210759341e8a1b08b864a539ce9dc7.tar.gz bcm5719-llvm-812bdb3c13210759341e8a1b08b864a539ce9dc7.zip  | |
[MS] Don't reference deleted copy ctors from catchable types
When throwing objects with deleted copy constructors, the copy ctor
field of the catchable type should remain null and the mangle name
changes. This already worked in simple cases, but in cases involving
non-trivial subobjects, sometimes LookupCopyingConstructor could return
a non-null but deleted constructor decl. Skip those and don't reference
them.
Fixes PR43680
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 2 | 
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 4fdd15bf466..67492a2cd46 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -921,7 +921,7 @@ bool Sema::CheckCXXThrowOperand(SourceLocation ThrowLoc,        // cannot be a simple walk of the class's decls.  Instead, we must perform        // lookup and overload resolution.        CXXConstructorDecl *CD = LookupCopyingConstructor(Subobject, 0); -      if (!CD) +      if (!CD || CD->isDeleted())          continue;        // Mark the constructor referenced as it is used by this throw expression.  | 

