<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 - Crash on invalid use of `_Nonnull` attribute through an alias template"
href="https://bugs.llvm.org/show_bug.cgi?id=51881">51881</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Crash on invalid use of `_Nonnull` attribute through an alias template
</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>All
</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>chandlerc@gmail.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><a href="https://compiler-explorer.com/z/EKfcebd97">https://compiler-explorer.com/z/EKfcebd97</a>
```
template <typename T>
using Nonnull = T _Nonnull;
Nonnull<int> x;
```
>From compiler explorer:
```
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-trunk/bin/clang++ -g -o
/app/output.s -mllvm --x86-asm-syntax=intel -S
--gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics
-fno-crash-diagnostics -std=c++20 -O2 -march=haswell -fsanitize=null
-fno-inline <source>
1. <source>:4:1: at annotation token
#0 0x000055ebf938a22f PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
#1 0x000055ebf93880f0 llvm::sys::CleanupOnSignal(unsigned long)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x35880f0)
#2 0x000055ebf92d8a68 CrashRecoverySignalHandler(int)
CrashRecoveryContext.cpp:0:0
#3 0x00007f02e24143c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
#4 0x000055ebfb934947 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformAttributedType(clang::TypeLocBuilder&,
clang::AttributedTypeLoc) SemaTemplateInstantiate.cpp:0:0
#5 0x000055ebfb9242cb clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&,
clang::TypeLoc) SemaTemplateInstantiate.cpp:0:0
#6 0x000055ebfb927a2a clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*)
SemaTemplateInstantiate.cpp:0:0
#7 0x000055ebfb927b38 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::QualType)
SemaTemplateInstantiate.cpp:0:0
#8 0x000055ebfb92894c clang::Sema::SubstType(clang::QualType,
clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation,
clang::DeclarationName)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x5b2894c)
#9 0x000055ebfb841180 clang::Sema::CheckTemplateIdType(clang::TemplateName,
clang::SourceLocation, clang::TemplateArgumentListInfo&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x5a41180)
#10 0x000055ebfb842baf clang::Sema::ActOnTemplateIdType(clang::Scope*,
clang::CXXScopeSpec&, clang::SourceLocation,
clang::OpaquePtr<clang::TemplateName>, clang::IdentifierInfo*,
clang::SourceLocation, clang::SourceLocation,
llvm::MutableArrayRef<clang::ParsedTemplateArgument>, clang::SourceLocation,
bool, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x5a42baf)
#11 0x000055ebfb21316d
clang::Parser::AnnotateTemplateIdTokenAsType(clang::CXXScopeSpec&, bool)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x541316d)
#12 0x000055ebfb17c3c2
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x537c3c2)
#13 0x000055ebfb1515af
clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x53515af)
#14 0x000055ebfb151e31
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.280) Parser.cpp:0:0
#15 0x000055ebfb157d59
clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x5357d59)
#16 0x000055ebfb159179
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x5359179)
#17 0x000055ebfb14c9d9 clang::ParseAST(clang::Sema&, bool, bool)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x534c9d9)
#18 0x000055ebfa2fa762 clang::CodeGenAction::ExecuteAction()
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x44fa762)
#19 0x000055ebf9c985e1 clang::FrontendAction::Execute()
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3e985e1)
#20 0x000055ebf9c35942
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3e35942)
#21 0x000055ebf9d658e3
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3f658e3)
#22 0x000055ebf70cf6dc cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x12cf6dc)
#23 0x000055ebf70cb75d ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#24 0x000055ebf9add095 void llvm::function_ref<void
()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
<span class="quote">>, std::__cxx11::basic_string<char, std::char_traits<char>,</span >
std::allocator<char> >*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#25 0x000055ebf92d9053
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x34d9053)
#26 0x000055ebf9adf14e
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
<span class="quote">>, std::__cxx11::basic_string<char, std::char_traits<char>,</span >
std::allocator<char> >*, bool*) const
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3cdf14e)
#27 0x000055ebf9ab4b7a
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3cb4b7a)
#28 0x000055ebf9ab56bf
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3cb56bf)
#29 0x000055ebf9abeaf5
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x3cbeaf5)
#30 0x000055ebf6fdfb8e main
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x11dfb8e)
#31 0x00007f02e1ec40b3 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x270b3)
#32 0x000055ebf70cb2da _start
(/opt/compiler-explorer/clang-trunk/bin/clang+++0x12cb2da)
clang-14: error: clang frontend command failed with exit code 139 (use -v to
see invocation)
Compiler returned: 139
```</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>