forked from OSchip/llvm-project
[Sema] Fix an assertion failure in -Wcompletion-handler
NamedDecl::getName() was being called on a constructor.
This commit is contained in:
parent
3fbd3eaf28
commit
c4355670b4
|
@ -936,8 +936,9 @@ private:
|
|||
|
||||
/// Return true if the only parameter of the function is conventional.
|
||||
static bool isOnlyParameterConventional(const FunctionDecl *Function) {
|
||||
return Function->getNumParams() == 1 &&
|
||||
hasConventionalSuffix(Function->getName());
|
||||
IdentifierInfo *II = Function->getIdentifier();
|
||||
return Function->getNumParams() == 1 && II &&
|
||||
hasConventionalSuffix(II->getName());
|
||||
}
|
||||
|
||||
/// Return true/false if 'swift_async' attribute states that the given
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
// RUN: %clang_cc1 -verify -fsyntax-only -Wcompletion-handler %s
|
||||
|
||||
// expected-no-diagnostics
|
||||
|
||||
class HasCtor {
|
||||
HasCtor(void *) {}
|
||||
};
|
Loading…
Reference in New Issue