<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 - Assertion `!isa<CXXConstructorDecl>(D) && "Use other ctor with ctor decls!"' failed."
   href="https://bugs.llvm.org/show_bug.cgi?id=44919">44919</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion `!isa<CXXConstructorDecl>(D) && "Use other ctor with ctor decls!"' failed.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>rupprecht@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This assertion is failing for me at head with this reduced repro (using a debug
build of clang):

$ cat repro.cc 
template <typename>
class b {
  __attribute__((target("avx"))) void c();
};
class B {
 public:
  __attribute__((target("avx"))) __attribute__((always_inline)) B();
};
template <typename d>
void b<d>::c() {
  B a;
}
template class b<int>;

$ clang++ -c repro.cc
clang++: llvm-project/clang/include/clang/AST/GlobalDecl.h:45: void
clang::GlobalDecl::Init(const clang::Decl *): Assertion
`!isa<CXXConstructorDecl>(D) && "Use other ctor with ctor decls!"' failed.
Stack dump:
0.      Program arguments: clang++ -c repro.cc
1.      repro.cc:13:22: current parser token ';'
2.      repro.cc:3:39: instantiating function definition 'b<int>::c'
3.      repro.cc:3:39: LLVM IR generation of declaration 'b<int>::c'
4.      repro.cc:3:39: Generating code for declaration 'b<int>::c'
 #0 0x0000000007f89b17 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
llvm-project/llvm/lib/Support/Unix/Signals.inc:564:11
... <irrelevant stack unwinding> ...
#11 0x00000000082d580f clang::GlobalDecl::Init(clang::Decl const*)
llvm-project/clang/include/clang/AST/GlobalDecl.h:46:5
#12 0x00000000082ded19 clang::GlobalDecl::GlobalDecl(clang::FunctionDecl
const*, unsigned int) llvm-project/clang/include/clang/AST/GlobalDecl.h:57:3
#13 0x0000000008615705
clang::CodeGen::CodeGenFunction::checkTargetFeatures(clang::SourceLocation,
clang::FunctionDecl const*)
llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp:2351:22
#14 0x000000000842a99d
clang::CodeGen::CodeGenFunction::EmitCall(clang::CodeGen::CGFunctionInfo
const&, clang::CodeGen::CGCallee const&, clang::CodeGen::ReturnValueSlot,
clang::CodeGen::CallArgList const&, llvm::CallBase**, clang::SourceLocation)
llvm-project/clang/lib/CodeGen/CGCall.cpp:3977:41
#15 0x00000000085e0d53
clang::CodeGen::CodeGenFunction::EmitCall(clang::CodeGen::CGFunctionInfo
const&, clang::CodeGen::CGCallee const&, clang::CodeGen::ReturnValueSlot,
clang::CodeGen::CallArgList const&, llvm::CallBase**)
llvm-project/clang/lib/CodeGen/CodeGenFunction.h:3621:12
#16 0x000000000862c70b
clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(clang::CXXConstructorDecl
const*, clang::CXXCtorType, bool, bool, clang::CodeGen::Address,
clang::CodeGen::CallArgList&, clang::CodeGen::AggValueSlot::Overlap_t,
clang::SourceLocation, bool) llvm-project/clang/lib/CodeGen/CGClass.cpp:2177:3
#17 0x000000000862be8e
clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(clang::CXXConstructorDecl
const*, clang::CXXCtorType, bool, bool, clang::CodeGen::AggValueSlot,
clang::CXXConstructExpr const*)
llvm-project/clang/lib/CodeGen/CGClass.cpp:2094:1
#18 0x00000000087c2e2e
clang::CodeGen::CodeGenFunction::EmitCXXConstructExpr(clang::CXXConstructExpr
const*, clang::CodeGen::AggValueSlot)
llvm-project/clang/lib/CodeGen/CGExprCXX.cpp:651:1
#19 0x000000000877dc7e (anonymous
namespace)::AggExprEmitter::VisitCXXConstructExpr(clang::CXXConstructExpr
const*) llvm-project/clang/lib/CodeGen/CGExprAgg.cpp:1269:1
#20 0x0000000008779b90 clang::StmtVisitorBase<std::add_pointer, (anonymous
namespace)::AggExprEmitter, void>::Visit(clang::Stmt*)
llvm-build/dev/tools/clang/include/clang/AST/StmtNodes.inc:679:1
#21 0x00000000087777ab (anonymous
namespace)::AggExprEmitter::Visit(clang::Expr*)
llvm-project/clang/lib/CodeGen/CGExprAgg.cpp:107:3
#22 0x00000000087773b4 clang::CodeGen::CodeGenFunction::EmitAggExpr(clang::Expr
const*, clang::CodeGen::AggValueSlot)
llvm-project/clang/lib/CodeGen/CGExprAgg.cpp:1849:1
...</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>