<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 failed: should not perform lookups into transparent contexts"
href="https://bugs.llvm.org/show_bug.cgi?id=49954">49954</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Assertion failed: should not perform lookups into transparent contexts
</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>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>aaron@aaronballman.com
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>This incomplete code snippet causes a failed assertion + crash:
```
extern "C++" inline namespace {
namespace a {
a : b
```
<source>:3:6: error: unexpected ':' in nested name specifier; did you mean
'::'?
a : b
^
::
clang++: /root/llvm-project/clang/lib/AST/DeclBase.cpp:1630:
clang::DeclContext::lookup_result
clang::DeclContext::lookup(clang::DeclarationName) const: Assertion
`getDeclKind() != Decl::LinkageSpec && getDeclKind() != Decl::Export && "should
not perform lookups into transparent contexts"' failed.
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-assertions-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++17 <source>
1. <source>:3:8: current parser token 'b'
2. <source>:1:22: parsing namespace '(anonymous)'
3. <source>:2:4: parsing namespace 'clang++:
/root/llvm-project/clang/lib/AST/DeclBase.cpp:1630:
clang::DeclContext::lookup_result
clang::DeclContext::lookup(clang::DeclarationName) const: Assertion
`getDeclKind() != Decl::LinkageSpec && getDeclKind() != Decl::Export && "should
not perform lookups into transparent contexts"' failed.
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH
or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamEi+0x2c)[0x56062d704fac]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN4llvm3sys17RunSignalHandlersEv+0x34)[0x56062d702e64]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(+0x36a4fd3)[0x56062d702fd3]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7f49cade33c0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb)[0x7f49ca8b318b]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x12b)[0x7f49ca892859]
/lib/x86_64-linux-gnu/libc.so.6(+0x25729)[0x7f49ca892729]
/lib/x86_64-linux-gnu/libc.so.6(+0x36f36)[0x7f49ca8a3f36]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZNK5clang11DeclContext6lookupENS_15DeclarationNameE+0x414)[0x56063005eed4]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZNK5clang9NamedDecl24printNestedNameSpecifierERN4llvm11raw_ostreamERKNS_14PrintingPolicyE+0x549)[0x560630044c59]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZNK5clang9NamedDecl18printQualifiedNameERN4llvm11raw_ostreamERKNS_14PrintingPolicyE+0x57)[0x560630045127]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZNK5clang25PrettyDeclStackTraceEntry5printERN4llvm11raw_ostreamE+0x16c)[0x56063003c4fc]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(+0x361fb5e)[0x56062d67db5e]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN4llvm3sys17RunSignalHandlersEv+0x34)[0x56062d702e64]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN4llvm3sys15CleanupOnSignalEm+0xb5)[0x56062d7030e5]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(+0x35ffcd8)[0x56062d65dcd8]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7f49cade33c0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb)[0x7f49ca8b318b]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x12b)[0x7f49ca892859]
/lib/x86_64-linux-gnu/libc.so.6(+0x25729)[0x7f49ca892729]
/lib/x86_64-linux-gnu/libc.so.6(+0x36f36)[0x7f49ca8a3f36]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZNK5clang11DeclContext6lookupENS_15DeclarationNameE+0x414)[0x56063005eed4]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZNK5clang9NamedDecl24printNestedNameSpecifierERN4llvm11raw_ostreamERKNS_14PrintingPolicyE+0x549)[0x560630044c59]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZNK5clang9NamedDecl18printQualifiedNameERN4llvm11raw_ostreamERKNS_14PrintingPolicyE+0x57)[0x560630045127]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang31FormatASTNodeDiagnosticArgumentENS_17DiagnosticsEngine12ArgumentKindElN4llvm9StringRefES3_NS2_8ArrayRefISt4pairIS1_lEEERNS2_15SmallVectorImplIcEEPvNS4_IlEE+0x8d1)[0x56062ff19e01]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZNK5clang10Diagnostic16FormatDiagnosticEPKcS2_RN4llvm15SmallVectorImplIcEE+0x46b)[0x56062d969a4b]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang21TextDiagnosticPrinter16HandleDiagnosticENS_17DiagnosticsEngine5LevelERKNS_10DiagnosticE+0x65)[0x56062e0217f5]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZNK5clang13DiagnosticIDs8EmitDiagERNS_17DiagnosticsEngineENS0_5LevelE+0x44)[0x56062d9742c4]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZNK5clang13DiagnosticIDs11ProcessDiagERNS_17DiagnosticsEngineE+0xa9)[0x56062d9746a9]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang17DiagnosticsEngine21EmitCurrentDiagnosticEb+0x5b)[0x56062d968e1b]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang4Sema21EmitCurrentDiagnosticEj+0x161)[0x56062f5a9e31]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(+0x554c158)[0x56062f5aa158]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang4Sema21SemaDiagnosticBuilderD1Ev+0x6d)[0x56062f5aa72d]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang4Sema23DiagnoseUnknownTypeNameERPNS_14IdentifierInfoENS_14SourceLocationEPNS_5ScopeEPNS_12CXXScopeSpecERNS_9OpaquePtrINS_8QualTypeEEEb+0x6fd)[0x56062f70f5fd]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang6Parser16ParseImplicitIntERNS_8DeclSpecEPNS_12CXXScopeSpecERKNS0_18ParsedTemplateInfoENS_15AccessSpecifierENS0_15DeclSpecContextERNS_25ParsedAttributesWithRangeE+0x162)[0x56062f4cfdc2]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang6Parser26ParseDeclarationSpecifiersERNS_8DeclSpecERKNS0_18ParsedTemplateInfoENS_15AccessSpecifierENS0_15DeclSpecContextEPNS0_18LateParsedAttrListE+0x1e3)[0x56062f4cb3b3]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang6Parser30ParseDeclOrFunctionDefInternalERNS_25ParsedAttributesWithRangeERNS_15ParsingDeclSpecENS_15AccessSpecifierE+0x7f)[0x56062f4abcbf]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(+0x544e5a1)[0x56062f4ac5a1]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang6Parser24ParseExternalDeclarationERNS_25ParsedAttributesWithRangeEPNS_15ParsingDeclSpecE+0x130)[0x56062f4ac790]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang6Parser19ParseInnerNamespaceERKN4llvm11SmallVectorINS0_18InnerNamespaceInfoELj4EEEjRNS_14SourceLocationERNS_16ParsedAttributesERNS_24BalancedDelimiterTrackerE+0xae)[0x56062f4e210e]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang6Parser14ParseNamespaceENS_17DeclaratorContextERNS_14SourceLocationES2_+0x960)[0x56062f4e2c80]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang6Parser16ParseDeclarationENS_17DeclaratorContextERNS_14SourceLocationERNS_25ParsedAttributesWithRangeEPS2_+0x2af)[0x56062f4d216f]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang6Parser24ParseExternalDeclarationERNS_25ParsedAttributesWithRangeEPNS_15ParsingDeclSpecE+0x15d)[0x56062f4ac7bd]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang6Parser19ParseInnerNamespaceERKN4llvm11SmallVectorINS0_18InnerNamespaceInfoELj4EEEjRNS_14SourceLocationERNS_16ParsedAttributesERNS_24BalancedDelimiterTrackerE+0xae)[0x56062f4e210e]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang6Parser14ParseNamespaceENS_17DeclaratorContextERNS_14SourceLocationES2_+0x960)[0x56062f4e2c80]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang6Parser16ParseDeclarationENS_17DeclaratorContextERNS_14SourceLocationERNS_25ParsedAttributesWithRangeEPS2_+0x2af)[0x56062f4d216f]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang6Parser24ParseExternalDeclarationERNS_25ParsedAttributesWithRangeEPNS_15ParsingDeclSpecE+0x15d)[0x56062f4ac7bd]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang6Parser12ParseLinkageERNS_15ParsingDeclSpecENS_17DeclaratorContextE+0x31b)[0x56062f4e858b]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang6Parser30ParseDeclOrFunctionDefInternalERNS_25ParsedAttributesWithRangeERNS_15ParsingDeclSpecENS_15AccessSpecifierE+0x32e)[0x56062f4abf6e]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(+0x544e5a1)[0x56062f4ac5a1]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang6Parser24ParseExternalDeclarationERNS_25ParsedAttributesWithRangeEPNS_15ParsingDeclSpecE+0x130)[0x56062f4ac790]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang6Parser17ParseTopLevelDeclERNS_9OpaquePtrINS_12DeclGroupRefEEEb+0x149)[0x56062f4ad3d9]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang6Parser22ParseFirstTopLevelDeclERNS_9OpaquePtrINS_12DeclGroupRefEEE+0x35)[0x56062f4ad745]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang8ParseASTERNS_4SemaEbb+0x1f3)[0x56062f4a3933]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang13CodeGenAction13ExecuteActionEv+0xa8)[0x56062e64e5f8]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang14FrontendAction7ExecuteEv+0xe1)[0x56062dfd5fb1]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang16CompilerInstance13ExecuteActionERNS_14FrontendActionE+0x162)[0x56062df71672]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang25ExecuteCompilerInvocationEPNS_16CompilerInstanceE+0xb0a)[0x56062e0a19aa]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_Z8cc1_mainN4llvm8ArrayRefIPKcEES2_Pv+0x13bc)[0x56062b3a4c6c]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(+0x1341f89)[0x56062b39ff89]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(+0x3dd0cf5)[0x56062de2ecf5]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN4llvm20CrashRecoveryContext9RunSafelyENS_12function_refIFvvEEE+0x23)[0x56062d65ddb3]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(+0x3dd1694)[0x56062de2f694]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZNK5clang6driver11Compilation14ExecuteCommandERKNS0_7CommandERPS3_+0x9a)[0x56062de079aa]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZNK5clang6driver11Compilation11ExecuteJobsERKNS0_7JobListERN4llvm15SmallVectorImplISt4pairIiPKNS0_7CommandEEEE+0x29f)[0x56062de0864f]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_ZN5clang6driver6Driver18ExecuteCompilationERNS0_11CompilationERN4llvm15SmallVectorImplISt4pairIiPKNS0_7CommandEEEE+0x9a)[0x56062de10fea]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(main+0x1c70)[0x56062b2b8ab0]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7f49ca8940b3]
/opt/compiler-explorer/clang-assertions-trunk/bin/clang++(_start+0x2a)[0x56062b39faca]
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>