[llvm-bugs] [Bug 38903] New: assert in clang::TemplateDeclInstantiator::VisitOMPDeclareReductionDecl

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 11 13:47:51 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=38903

            Bug ID: 38903
           Summary: assert in
                    clang::TemplateDeclInstantiator::VisitOMPDeclareReduct
                    ionDecl
           Product: OpenMP
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Clang Compiler Support
          Assignee: unassignedclangbugs at nondot.org
          Reporter: kli at ca.ibm.com
                CC: a.bataev at hotmail.com, llvm-bugs at lists.llvm.org

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
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180911/ceb1b109/attachment.html>


More information about the llvm-bugs mailing list