<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - assert in clang::TemplateDeclInstantiator::VisitOMPDeclareReductionDecl"
   href="https://bugs.llvm.org/show_bug.cgi?id=38903">38903</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>assert in clang::TemplateDeclInstantiator::VisitOMPDeclareReductionDecl
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>OpenMP
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Clang Compiler Support
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>kli@ca.ibm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>a.bataev@hotmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>struct U
{
  void foo(U&, bool);
  U();
};
template <int N>
struct S
{
  int s;
  void foo(S &x) {};
  #pragma omp declare reduction (foo : U, S : omp_out.foo(omp_in, false))
};
#pragma omp declare reduction (bar : S<1> : omp_out.foo(omp_in))


$ clang++ -fopenmp d3.cpp
clang-8: /llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp:2933:
llvm::PointerUnion<clang::Decl*, llvm::SmallVector<clang::ParmVarDecl*, 4u>*>*
clang::LocalInstantiationScope::findInstantiationOf(const clang::Decl*):
Assertion `isa<LabelDecl>(D) && "declaration not instantiated in this scope"'
failed.
Stack dump:
...
1.      d3.cpp:13:53: current parser token 'foo'
2.      d3.cpp:7:8: instantiating class definition 'S<1>'
#0 0x000000001387ee00 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/llvm/lib/Support/Unix/Signals.inc:490:0
#1 0x000000001387ef04 PrintStackTraceSignalHandler(void*)
/llvm/lib/Support/Unix/Signals.inc:553:0
#2 0x000000001387c568 llvm::sys::RunSignalHandlers()
/llvm/lib/Support/Signals.cpp:66:0
#3 0x000000001387e4f4 SignalHandler(int)
/llvm/lib/Support/Unix/Signals.inc:343:0
#4 0x00003fffad940478  0x478 __GI_abort
#5 0x00003fffad940478 
#6 0x00003fffad940478 __assert_fail_base (+0x478)
#7 0x00003fffad3b0d70 __GI___assert_fail (/lib64/libc.so.6+0x40d70)
#8 0x00003fffad3a48a4
clang::LocalInstantiationScope::findInstantiationOf(clang::Decl const*)
/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp:2933:0
#9 0x00003fffad3a4994
clang::TemplateDeclInstantiator::VisitOMPDeclareReductionDecl(clang::OMPDeclareReductionDecl*)
/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:2750:0
#10 0x0000000017c11620 clang::declvisitor::Base<clang::declvisitor::make_ptr,
clang::TemplateDeclInstantiator, clang::Decl*>::Visit(clang::Decl*)
/clang/build/tools/clang/include/clang/AST/DeclNodes.inc:503:0
...</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>