Index: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp =================================================================== --- cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -1871,11 +1871,13 @@ Constructor->isExplicit(), Constructor->isInlineSpecified(), false, Constructor->isConstexpr()); + Method->setRangeEnd(Constructor->getLocEnd()); } else if (CXXDestructorDecl *Destructor = dyn_cast(D)) { Method = CXXDestructorDecl::Create(SemaRef.Context, Record, StartLoc, NameInfo, T, TInfo, Destructor->isInlineSpecified(), false); + Method->setRangeEnd(Destructor->getLocEnd()); } else if (CXXConversionDecl *Conversion = dyn_cast(D)) { Method = CXXConversionDecl::Create(SemaRef.Context, Record, StartLoc, NameInfo, T, TInfo, Index: cfe/trunk/test/Misc/ast-dump-decl.cpp =================================================================== --- cfe/trunk/test/Misc/ast-dump-decl.cpp +++ cfe/trunk/test/Misc/ast-dump-decl.cpp @@ -223,6 +223,10 @@ class D { }; template class TestClassTemplate { + public: + TestClassTemplate(); + ~TestClassTemplate(); + int j(); int i; }; @@ -252,10 +256,18 @@ // CHECK-NEXT: TemplateTypeParmDecl // CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate // CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate +// CHECK-NEXT: AccessSpecDecl{{.*}} public +// CHECK-NEXT: CXXConstructorDecl{{.*}} +// CHECK-NEXT: CXXDestructorDecl{{.*}} +// CHECK-NEXT: CXXMethodDecl{{.*}} // CHECK-NEXT: FieldDecl{{.*}} i // CHECK-NEXT: ClassTemplateSpecializationDecl{{.*}} class TestClassTemplate // CHECK-NEXT: TemplateArgument{{.*}}A // CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate +// CHECK-NEXT: AccessSpecDecl{{.*}} public +// CHECK-NEXT: CXXConstructorDecl{{.*}} +// CHECK-NEXT: CXXDestructorDecl{{.*}} +// CHECK-NEXT: CXXMethodDecl{{.*}} // CHECK-NEXT: FieldDecl{{.*}} i // CHECK: ClassTemplateSpecialization{{.*}} 'TestClassTemplate' // CHECK-NEXT: ClassTemplateSpecialization{{.*}} 'TestClassTemplate' @@ -269,11 +281,19 @@ // CHECK: ClassTemplateSpecializationDecl{{.*}} class TestClassTemplate // CHECK-NEXT: TemplateArgument{{.*}}C // CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate +// CHECK-NEXT: AccessSpecDecl{{.*}} public +// CHECK-NEXT: CXXConstructorDecl{{.*}} +// CHECK-NEXT: CXXDestructorDecl{{.*}} +// CHECK-NEXT: CXXMethodDecl{{.*}} // CHECK-NEXT: FieldDecl{{.*}} i // CHECK: ClassTemplateSpecializationDecl{{.*}} class TestClassTemplate // CHECK-NEXT: TemplateArgument{{.*}}D // CHECK-NEXT: CXXRecordDecl{{.*}} class TestClassTemplate +// CHECK-NEXT: AccessSpecDecl{{.*}} public +// CHECK-NEXT: CXXConstructorDecl{{.*}} +// CHECK-NEXT: CXXDestructorDecl{{.*}} +// CHECK-NEXT: CXXMethodDecl{{.*}} // CHECK-NEXT: FieldDecl{{.*}} i // CHECK: ClassTemplatePartialSpecializationDecl{{.*}} class TestClassTemplatePartial