Commit c4355670 authored by Erik Pilkington's avatar Erik Pilkington
Browse files

[Sema] Fix an assertion failure in -Wcompletion-handler

NamedDecl::getName() was being called on a constructor.
parent 3fbd3eaf
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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
+7 −0
Original line number Diff line number Diff line
// RUN: %clang_cc1 -verify -fsyntax-only -Wcompletion-handler %s

// expected-no-diagnostics

class HasCtor {
  HasCtor(void *) {}
};