<div dir="ltr">Following compilation shows the issue:<br><br>    $ clang++ --version<br>    clang version 6.0.0 (trunk 316414)<br>    Target: x86_64-unknown-linux-gnu<br>    Thread model: posix<br>    InstalledDir: /opt/compiler-explorer/clang-trunk/bin<br><br>    $ cat a.cpp<br>    template <typename T><br>    struct S<br>    {<br>      template <typename U><br>      S(U&&) {}<br>    };<br><br>    template <typename T><br>    S(T) -> S<T>;<br><br>    int main()<br>    {<br>      S s(42);<br>    }<br><br>    $ clang++ -std=c++17 -Wundefined-func-template a.cpp<br>    a.cpp:13:7: warning: instantiation of function '<deduction guide for S><int>' required here, but no definition is available [-Wundefined-func-template]<br>        S s(42);<br>          ^<br>    a.cpp:9:1: note: forward declaration of template entity is here<br>        S(T) -> S<T>;<br>        ^<br>    a.cpp:13:7: note: add an explicit instantiation declaration to suppress this warning if '<deduction guide for S><int>' is explicitly instantiated in another translation unit<br>            S s(42);<br>              ^<br><br>I found out that this warning occurs at lib/Sema/SemaTemplateInstantiateDecl.cpp:3809:<br><br>    else if (TSK == TSK_ExplicitInstantiationDefinition) {<br>      // Try again at the end of the translation unit (at which point a<br>      // definition will be required).<br>      assert(!Recursive);<br>      Function->setInstantiationIsPending(true);<br>      PendingInstantiations.push_back(<br>        std::make_pair(Function, PointOfInstantiation));<br>    } else if (TSK == TSK_ImplicitInstantiation) { //< here<br>      if (AtEndOfTU && !getDiagnostics().hasErrorOccurred()) {<br>        Diag(PointOfInstantiation, diag::warn_func_template_missing)<br>          << Function;<br>        Diag(PatternDecl->getLocation(), diag::note_forward_template_decl);<br>        if (getLangOpts().CPlusPlus11)<br>          Diag(PointOfInstantiation, diag::note_inst_declaration_hint)<br>            << Function;<br>      }<br>    }<br><br>Shouldn't that check whether it's a deduction guide?</div>