Handle parsing of extern templates

This commit is contained in:
Jonathan Müller 2017-10-30 22:25:12 +01:00
commit 0875721452
2 changed files with 11 additions and 1 deletions

View file

@ -24,6 +24,10 @@ namespace
detail::skip_if(stream, "friend");
if (detail::skip_if(stream, "extern"))
// extern template
detail::skip(stream, "template");
switch (kind)
{
case CXCursor_ClassDecl:

View file

@ -92,6 +92,12 @@ class a<T*> {};
/// };
template <typename T>
struct b<0, T> {};
// extern template for good measure
// currently not really supported but parsing must not fail
/// template<>
/// class a<int>;
extern template class a<int>;
)";
cpp_entity_index idx;
@ -263,5 +269,5 @@ struct b<0, T> {};
else
REQUIRE(false);
});
REQUIRE(count == 4u);
REQUIRE(count == 5u);
}