declaration with dependent type. Fixes PR10232 /
<rdar://problem/
9700653>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134515
91177308-0d34-0410-b5e6-
96231b3b80d8
ExDeclType, TInfo, SC_None, SC_None);
ExDecl->setExceptionVariable(true);
- if (!Invalid) {
+ if (!Invalid && !ExDeclType->isDependentType()) {
if (const RecordType *recordType = ExDeclType->getAs<RecordType>()) {
// C++ [except.handle]p16:
// The object declared in an exception-declaration or, if the
template struct TryCatch0<int&&>; // expected-note{{instantiation}}
template struct TryCatch0<int>; // expected-note{{instantiation}}
+
+namespace PR10232 {
+ template <typename T>
+ class Templated {
+ struct Exception {
+ private:
+ Exception(const Exception&); // expected-note{{declared private here}}
+ };
+ void exception() {
+ try {
+ } catch(Exception e) { // expected-error{{calling a private constructor of class 'PR10232::Templated<int>::Exception'}}
+ }
+ }
+ };
+
+ template class Templated<int>; // expected-note{{in instantiation of member function 'PR10232::Templated<int>::exception' requested here}}
+}