Index: lib/Sema/SemaDeclCXX.cpp =================================================================== --- lib/Sema/SemaDeclCXX.cpp +++ lib/Sema/SemaDeclCXX.cpp @@ -9462,11 +9462,13 @@ return true; } - Diag(SS.getRange().getBegin(), - diag::err_using_decl_nested_name_specifier_is_not_base_class) - << SS.getScopeRep() - << cast(CurContext) - << SS.getRange(); + if (!cast(NamedContext)->isInvalidDecl()) { + Diag(SS.getRange().getBegin(), + diag::err_using_decl_nested_name_specifier_is_not_base_class) + << SS.getScopeRep() + << cast(CurContext) + << SS.getRange(); + } return true; } Index: test/SemaCXX/using-decl-templates.cpp =================================================================== --- test/SemaCXX/using-decl-templates.cpp +++ test/SemaCXX/using-decl-templates.cpp @@ -92,3 +92,12 @@ template struct APtr; // expected-error{{elaborated type refers to a type alias template}} } + +namespace DontDiagnoseInvalidTest { +template struct Base { + static_assert(Value, ""); // expected-error {{static_assert failed}} +}; +struct Derived : Base { // expected-note {{requested here}} + using Base::Base; // OK. Don't diagnose that 'Base' isn't a base class of Derived. +}; +} // namespace DontDiagnoseInvalidTest