Index: lib/Sema/SemaDecl.cpp =================================================================== --- lib/Sema/SemaDecl.cpp +++ lib/Sema/SemaDecl.cpp @@ -3562,7 +3562,12 @@ } } - if (OldQTypeForComparison == NewQType) + // Exception specifiers have already been compared here so ignore them for + // the purposes of this comparison. Microsoft compatability mode explicitly + // downgrades such mismatches to a warning and we shouldn't make it an error + // here. + if (Context.hasSameFunctionTypeIgnoringExceptionSpec(OldQTypeForComparison, + NewQType)) return MergeCompatibleFunctionDecls(New, Old, S, MergeTypeWithOld); // If the types are imprecise (due to dependent constructs in friends or Index: test/SemaCXX/ms-ignore-mismatched-except-specifier.cpp =================================================================== --- /dev/null +++ test/SemaCXX/ms-ignore-mismatched-except-specifier.cpp @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 %s -std=c++1z -fms-extensions -fms-compatibility + +template struct FooPtr { + template FooPtr(U *p) : m_pT(nullptr) {} + template <> FooPtr(T *pInterface) throw() : m_pT(pInterface) {} // expected-warning {{exception specification in declaration does not match previous declaration}} + T *m_pT; +}; +struct Bar{}; +template struct FooPtr;