diff options
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/CodeGen/CGException.cpp | 5 | ||||
| -rw-r--r-- | clang/test/CodeGenCXX/try-catch.cpp | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp index 0b7e57a3c5f..9da910d9d08 100644 --- a/clang/lib/CodeGen/CGException.cpp +++ b/clang/lib/CodeGen/CGException.cpp @@ -610,8 +610,9 @@ void CodeGenFunction::EnterCXXTryStmt(const CXXTryStmt &S, bool IsFnTryBlock) { // existing compilers do, and it's not clear that the standard // personality routine is capable of doing this right. See C++ DR 388: // http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#388 - QualType CaughtType = C->getCaughtType(); - CaughtType = CaughtType.getNonReferenceType().getUnqualifiedType(); + Qualifiers CaughtTypeQuals; + QualType CaughtType = CGM.getContext().getUnqualifiedArrayType( + C->getCaughtType().getNonReferenceType(), CaughtTypeQuals); llvm::Constant *TypeInfo = nullptr; if (CaughtType->isObjCObjectPointerType()) diff --git a/clang/test/CodeGenCXX/try-catch.cpp b/clang/test/CodeGenCXX/try-catch.cpp index 89f229fee37..b50214ecdb9 100644 --- a/clang/test/CodeGenCXX/try-catch.cpp +++ b/clang/test/CodeGenCXX/try-catch.cpp @@ -11,3 +11,11 @@ void f() { } catch (const X x) { } } + +void h() { + try { + throw "ABC"; + // CHECK: @_ZTIPKc to i8 + } catch (char const(&)[4]) { + } +} |

