<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 - Clang assertion failure on templated friend member function"
href="https://bugs.llvm.org/show_bug.cgi?id=41792">41792</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang assertion failure on templated friend member function
</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>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>rtrieu@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>$ cat test.ii
template <class>
class S {
template <>
friend S* S::Run();
};
$ clang -fsyntax-only test.ii
...
clang-9: ../tools/clang/include/clang/AST/DeclTemplate.h:133: clang::NamedDecl
*clang::TemplateParameterList::getParam(unsigned int): Assertion `Idx < size()
&& "Template parameter index out-of-range"' failed.
...
#9 0x00000000048f3494 clang::TemplateParameterList::getParam(unsigned int)
#10 0x000000000728dc28 (anonymous
namespace)::DependencyChecker::DependencyChecker(clang::TemplateParameterList*,
bool)
#11 0x000000000722ed2f DependsOnTemplateParameters(clang::QualType,
clang::TemplateParameterList*)
#12 0x000000000722e297
clang::Sema::MatchTemplateParametersToScopeSpecifier(clang::SourceLocation,
clang::SourceLocation, clang::CXXScopeSpec const&,
clang::TemplateIdAnnotation*, llvm::ArrayRef<clang::TemplateParameterList*>,
bool, bool&, bool&)
#13 0x0000000006a1fb70 clang::Sema::ActOnFunctionDeclarator(clang::Scope*,
clang::Declarator&, clang::DeclContext*, clang::TypeSourceInfo*,
clang::LookupResult&, llvm::MutableArrayRef<clang::TemplateParameterList*>,
bool&)
#14 0x0000000006c7acdb clang::Sema::ActOnFriendFunctionDecl(clang::Scope*,
clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>)
#15 0x00000000067a1af7
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject*)
#16 0x0000000006831070
clang::Parser::ParseSingleDeclarationAfterTemplate(clang::DeclaratorContext,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier)
#17 0x0000000006830ccd
clang::Parser::ParseTemplateDeclarationOrSpecialization(clang::DeclaratorContext,
clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier)
#18 0x00000000067a0a60
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject*)
#19 0x00000000067a3204
clang::Parser::ParseCXXClassMemberDeclarationWithPragmas(clang::AccessSpecifier&,
clang::Parser::ParsedAttributesWithRange&, clang::TypeSpecifierType,
clang::Decl*)
#20 0x000000000679e8a2
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*)
#21 0x000000000679d288
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&)
#22 0x0000000006778022
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*)
#23 0x000000000683120d
clang::Parser::ParseSingleDeclarationAfterTemplate(clang::DeclaratorContext,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier)
#24 0x0000000006830ccd
clang::Parser::ParseTemplateDeclarationOrSpecialization(clang::DeclaratorContext,
clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier)
#25 0x0000000006830656
clang::Parser::ParseDeclarationStartingWithTemplate(clang::DeclaratorContext,
clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier)
#26 0x0000000006774629
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&)
#27 0x0000000006753fd9
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
#28 0x00000000067527bf
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
#29 0x0000000006752123
clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
#30 0x000000000674ddee clang::ParseAST(clang::Sema&, bool, bool)
#31 0x00000000046fb172 clang::ASTFrontendAction::ExecuteAction()
...</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>