<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 dependent name destructor call"
   href="https://bugs.llvm.org/show_bug.cgi?id=44829">44829</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Crash on dependent name destructor call
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>9.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>laurynas.biveinis@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23108" name="attach_23108" title="Preprocessed and delta-reduced sources">attachment 23108</a> <a href="attachment.cgi?id=23108&action=edit" title="Preprocessed and delta-reduced sources">[details]</a></span>
Preprocessed and delta-reduced sources

Compiling the following crashes with the following stacktrace:

Stack dump:
0.      Program arguments: /usr/local/Cellar/llvm/9.0.1/bin/clang-9 -cc1
-triple x86_64-apple-macosx10.15.0 -Wdeprecated-objc-isa-usage
-Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -discard-value-names -main-file-name art2.cpp
-mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim
-masm-verbose -munwind-tables -target-sdk-version=10.15 -target-cpu penryn
-dwarf-column-info -debugger-tuning=lldb -ggnu-pubnames -target-linker-version
530 -coverage-notes-file
/Users/laurynas/unodb/olc/build.llvm-debug/CMakeFiles/unodb.dir/art.cpp.gcno
-resource-dir /usr/local/Cellar/llvm/9.0.1/lib/clang/9.0.1 -isystem
/Users/laurynas/unodb/olc/GSL/include -isystem /usr/local/include -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk
-I /Users/laurynas/unodb/olc/build.llvm-debug -stdlib=libc++ -internal-isystem
/usr/local/opt/llvm/bin/../include/c++/v1 -internal-isystem
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/c++/v1
-internal-isystem
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/local/include
-internal-isystem /usr/local/Cellar/llvm/9.0.1/lib/clang/9.0.1/include
-internal-externc-isystem
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include
-std=c++17 -fdeprecated-macro -fdebug-compilation-dir
/Users/laurynas/unodb/olc/build.llvm-debug -ferror-limit 19 -fmessage-length
238 -stack-protector 1 -fblocks -fencode-extended-block-signature
-fregister-global-dtors-with-atexit -fobjc-runtime=macosx-10.15.0
-fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option
-fcolor-diagnostics -o CMakeFiles/unodb.dir/art.cpp.o -x c++ ../art2.cpp 
1.      ../art2.cpp:10:34: current parser token '('
2.      ../art2.cpp:4:1: parsing struct/union/class body
'basic_raii_node_ptr_deleter'
3.      ../art2.cpp:9:34: parsing function body
'basic_raii_node_ptr_deleter::~basic_raii_node_ptr_deleter<NodePtr>'
4.      ../art2.cpp:9:34: in compound statement ('{}')
0  clang-9                  0x000000010303e8e6
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  clang-9                  0x000000010303ed38 SignalHandler(int) + 180
2  libsystem_platform.dylib 0x00007fff63dbf42d _sigtramp + 29
3  libsystem_platform.dylib 0x00007ffeedd86ca0 _sigtramp + 18446744071729608848
4  clang-9                  0x00000001043fce93
clang::NestedNameSpecifier::containsUnexpandedParameterPack() const + 17
5  clang-9                  0x000000010429019d
clang::DependentNameType::DependentNameType(clang::ElaboratedTypeKeyword,
clang::NestedNameSpecifier*, clang::IdentifierInfo const*, clang::QualType) +
37
6  clang-9                  0x0000000104280072
clang::ASTContext::getDependentNameType(clang::ElaboratedTypeKeyword,
clang::NestedNameSpecifier*, clang::IdentifierInfo const*, clang::QualType)
const + 254
7  clang-9                  0x0000000104117d47
clang::Sema::CheckTypenameType(clang::ElaboratedTypeKeyword,
clang::SourceLocation, clang::NestedNameSpecifierLoc, clang::IdentifierInfo
const&, clang::SourceLocation) + 147
8  clang-9                  0x0000000103fbdfff
clang::Sema::getDestructorName(clang::SourceLocation, clang::IdentifierInfo&,
clang::SourceLocation, clang::Scope*, clang::CXXScopeSpec&,
clang::OpaquePtr<clang::QualType>, bool) + 1463
9  clang-9                  0x0000000103d5c74f
clang::Parser::ParseUnqualifiedId(clang::CXXScopeSpec&, bool, bool, bool, bool,
clang::OpaquePtr<clang::QualType>, clang::SourceLocation*,
clang::UnqualifiedId&) + 2801
10 clang-9                  0x0000000103d4fe95
clang::Parser::ParsePostfixExpressionSuffix(clang::ActionResult<clang::Expr*,
true>) + 4583
11 clang-9                  0x0000000103d5222c
clang::Parser::ParseCastExpression(bool, bool, bool&,
clang::Parser::TypeCastState, bool) + 7640
12 clang-9                  0x0000000103d4ec1c
clang::Parser::ParseCastExpression(bool, bool, clang::Parser::TypeCastState,
bool) + 34
13 clang-9                  0x0000000103d4daa3
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) + 143
14 clang-9                  0x0000000103d4d9fe
clang::Parser::ParseExpression(clang::Parser::TypeCastState) + 14
15 clang-9                  0x0000000103d8aebc
clang::Parser::ParseExprStatement(clang::Parser::ParsedStmtContext) + 56
16 clang-9                  0x0000000103d8a52f
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*,
clang::Parser::ParsedAttributesWithRange&) + 1149
17 clang-9                  0x0000000103d8a019
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) + 155
18 clang-9                  0x0000000103d8f85e
clang::Parser::ParseCompoundStatementBody(bool) + 1070
19 clang-9                  0x0000000103d90364
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 172
20 clang-9                  0x0000000103d21ef8
clang::Parser::ParseLexedMethodDef(clang::Parser::LexedMethod&) + 496
21 clang-9                  0x0000000103d213bd
clang::Parser::ParseLexedMethodDefs(clang::Parser::ParsingClass&) + 161
22 clang-9                  0x0000000103d445ad
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) + 2607
23 clang-9                  0x0000000103d42eaf
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 6379
24 clang-9                  0x0000000103d2a607
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 1017
25 clang-9                  0x0000000103d95971
clang::Parser::ParseSingleDeclarationAfterTemplate(clang::DeclaratorContext,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) + 399
26 clang-9                  0x0000000103d950aa
clang::Parser::ParseTemplateDeclarationOrSpecialization(clang::DeclaratorContext,
clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) +
1058
27 clang-9                  0x0000000103d94b63
clang::Parser::ParseDeclarationStartingWithTemplate(clang::DeclaratorContext,
clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) + 131
28 clang-9                  0x0000000103d29d61
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 177
29 clang-9                  0x0000000103da1b56
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 412
30 clang-9                  0x0000000103da0e02
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
+ 942
31 clang-9                  0x0000000103d1ef6f clang::ParseAST(clang::Sema&,
bool, bool) + 434
32 clang-9                  0x00000001034f07ab clang::FrontendAction::Execute()
+ 77
33 clang-9                  0x00000001034bc732
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 816
34 clang-9                  0x000000010353ef2b
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1354
35 clang-9                  0x0000000101e786fb cc1_main(llvm::ArrayRef<char
const*>, char const*, void*) + 1739
36 clang-9                  0x0000000101e770a3 main + 7485
37 libdyld.dylib            0x00007fff63bc67fd start + 1
clang-9: error: unable to execute command: Segmentation fault: 11
clang-9: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 9.0.1 
Target: x86_64-apple-darwin19.3.0

I am attaching preprocessed and delta-reduced sources. To illustrate, a
non-preprocessed testcase is
---
#include <memory>

template <class NodePtr>
union basic_raii_node_ptr_deleter {
  using inode256_type = typename NodePtr::inode256_type;

  const std::unique_ptr<inode256_type> node_256;

  ~basic_raii_node_ptr_deleter() {
    node_256.template ~unique_ptr();
  }
};
---
where <memory> is from Apple standard C++ headers.</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>