Index: lib/Sema/SemaExprCXX.cpp =================================================================== --- lib/Sema/SemaExprCXX.cpp +++ lib/Sema/SemaExprCXX.cpp @@ -4389,7 +4389,18 @@ // resolution point. if (isa(ND)) continue; - const CXXConstructorDecl *Constructor = cast(ND); + // UsingDecl itself is not a constructor + if (isa(ND)) + continue; + const CXXConstructorDecl *Constructor = nullptr; + if (auto *CSD = dyn_cast(ND)) { + Constructor = cast(CSD->getTargetDecl()); + // Default constructor and copy/move constructor are not inherited. + if (Constructor->isDefaultConstructor() || + Constructor->isCopyOrMoveConstructor()) + continue; + } else + Constructor = cast(ND); if (Constructor->isCopyConstructor(FoundTQs)) { FoundConstructor = true; const FunctionProtoType *CPT @@ -4425,7 +4436,18 @@ // FIXME: In C++0x, a constructor template can be a default constructor. if (isa(ND)) continue; - const CXXConstructorDecl *Constructor = cast(ND); + // UsingDecl itself is not a constructor + if (isa(ND)) + continue; + const CXXConstructorDecl *Constructor = nullptr; + if (auto *CSD = dyn_cast(ND)) { + Constructor = cast(CSD->getTargetDecl()); + // Default constructor and copy/move constructor are not inherited. + if (Constructor->isDefaultConstructor() || + Constructor->isCopyOrMoveConstructor()) + continue; + } else + Constructor = cast(ND); if (Constructor->isDefaultConstructor()) { FoundConstructor = true; const FunctionProtoType *CPT Index: test/SemaCXX/cxx11-crashes.cpp =================================================================== --- test/SemaCXX/cxx11-crashes.cpp +++ test/SemaCXX/cxx11-crashes.cpp @@ -91,3 +91,10 @@ Foo(lambda); } } + +namespace pr29091 { + struct X{ X(const X &x); }; + struct Y: X { using X::X; }; + bool foo() { return __has_nothrow_constructor(Y); } + bool bar() { return __has_nothrow_copy(Y); } +}