diff --git a/lib/AST/ODRHash.cpp b/lib/AST/ODRHash.cpp index 83355270c59a..a1c2fbb0c4f2 100644 --- a/lib/AST/ODRHash.cpp +++ b/lib/AST/ODRHash.cpp @@ -150,13 +150,16 @@ void ODRHash::AddTemplateArgument(TemplateArgument TA) { case TemplateArgument::Declaration: case TemplateArgument::NullPtr: case TemplateArgument::Integral: + break; case TemplateArgument::Template: case TemplateArgument::TemplateExpansion: + AddTemplateName(TA.getAsTemplateOrTemplatePattern()); break; case TemplateArgument::Expression: AddStmt(TA.getAsExpr()); break; case TemplateArgument::Pack: + llvm_unreachable("Pack"); break; } } diff --git a/test/Modules/odr_hash.cpp b/test/Modules/odr_hash.cpp index 36f2e4bea00c..51bd62697246 100644 --- a/test/Modules/odr_hash.cpp +++ b/test/Modules/odr_hash.cpp @@ -1051,6 +1051,24 @@ S3 s3; // expected-note@first.h:* {{but in 'FirstModule' found type alias 'T' with different underlying type 'U3<2>'}} #endif +#if defined(FIRST) +template struct T4a {}; +template