Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions clang/lib/AST/ByteCode/Compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6800,6 +6800,10 @@ bool Compiler<Emitter>::emitDestruction(const Descriptor *Desc,
assert(!Desc->isPrimitive());
assert(!Desc->isPrimitiveArray());

// Can happen if the decl is invalid.
if (Desc->isDummy())
return true;

// Arrays.
if (Desc->isArray()) {
const Descriptor *ElemDesc = Desc->ElemDesc;
Expand Down
11 changes: 11 additions & 0 deletions clang/test/AST/ByteCode/cxx17.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,14 @@ namespace constant {
}
static_assert(f());
}


template <int a> struct i; // both-note {{template is declared here}}
template <> struct i<0> {};

template <int x> constexpr auto c() {
i<x> g; // both-error {{implicit instantiation of undefined template 'i<1>'}}
return 0;
}

auto y = c<1>(); // both-note {{in instantiation of function template specialization 'c<1>' requested here}}