forked from OSchip/llvm-project
[clang] Don't segfault on incorrect using directive (PR41400)
Summary: this is a bugfixe for [[ https://bugs.llvm.org/show_bug.cgi?id=41400 | PR41400 ]] added nullptr check at the relevent place and test Reviewers: rsmith, riccibruno Reviewed By: rsmith Subscribers: jkooker, jkorous, riccibruno, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60523 llvm-svn: 363360
This commit is contained in:
parent
d46ebd207b
commit
ef629c7ef8
|
@ -90,7 +90,7 @@ ParsedType Sema::getConstructorName(IdentifierInfo &II,
|
|||
// When naming a constructor as a member of a dependent context (eg, in a
|
||||
// friend declaration or an inherited constructor declaration), form an
|
||||
// unresolved "typename" type.
|
||||
if (CurClass->isDependentContext() && !EnteringContext) {
|
||||
if (CurClass->isDependentContext() && !EnteringContext && SS.getScopeRep()) {
|
||||
QualType T = Context.getDependentNameType(ETK_None, SS.getScopeRep(), &II);
|
||||
return ParsedType::make(T);
|
||||
}
|
||||
|
|
|
@ -396,3 +396,10 @@ namespace tag_vs_var {
|
|||
using N::Y;
|
||||
using N::Z;
|
||||
}
|
||||
|
||||
// expected-error@+5 {{requires a qualified name}}
|
||||
// expected-error@+4 {{expected ';'}}
|
||||
// expected-error@+3 {{expected '}'}}
|
||||
// expected-note@+2 {{to match this '{'}}
|
||||
// expected-error@+1 {{expected ';'}}
|
||||
template<class> struct S { using S
|
Loading…
Reference in New Issue