<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 failure inheriting a constructor of const template parameter"
   href="https://bugs.llvm.org/show_bug.cgi?id=32385">32385</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion failure inheriting a constructor of const template parameter
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>4.0
          </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>david@doublewise.net
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The following code leads to an assertion failure:

struct base {
};

template<typename T>
struct inherit : T {
        using T::T;
};

int main() {
        inherit<base const>{};
}



This code worked in 3.9



david@localhost ~/test> clang++ source/main.cpp -std=c++1z
clang-4.0:
/var/tmp/portage/sys-devel/clang-4.0.0/work/x/y/cfe-4.0.0.src/lib/AST/DeclarationName.cpp:418:
clang::DeclarationName
clang::DeclarationNameTable::getCXXSpecialName(clang::DeclarationName::NameKind,
clang::CanQualType): Assertion `!Ty.hasQualifiers() &&"Constructor type must be
unqualified"' failed.
#0 0x00007ff447f99988 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/lib64/llvm/4/bin/../lib64/libLLVMSupport.so.4+0xf8988)
#1 0x00007ff447f9752e llvm::sys::RunSignalHandlers()
(/usr/lib64/llvm/4/bin/../lib64/libLLVMSupport.so.4+0xf652e)
#2 0x00007ff447f978e2
(/usr/lib64/llvm/4/bin/../lib64/libLLVMSupport.so.4+0xf68e2)
#3 0x00007ff446b3a0e0 (/lib64/libc.so.6+0x330e0)
#4 0x00007ff446b3a074 gsignal (/lib64/libc.so.6+0x33074)
#5 0x00007ff446b3b4da abort (/lib64/libc.so.6+0x344da)
#6 0x00007ff446b32df7 (/lib64/libc.so.6+0x2bdf7)
#7 0x00007ff446b32ea2 (/lib64/libc.so.6+0x2bea2)
#8 0x00007ff4459d8fcf
clang::DeclarationNameTable::getCXXSpecialName(clang::DeclarationName::NameKind,
clang::CanQual<clang::Type>)
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangAST.so.4+0x1b4fcf)
#9 0x00007ff44509f195
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangSema.so.4+0x583195)
#10 0x00007ff44509f3cc
clang::Sema::SubstDeclarationNameInfo(clang::DeclarationNameInfo const&,
clang::MultiLevelTemplateArgumentList const&)
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangSema.so.4+0x5833cc)
#11 0x00007ff4450cd122 clang::Decl*
clang::TemplateDeclInstantiator::instantiateUnresolvedUsingDecl<clang::UnresolvedUsingValueDecl>(clang::UnresolvedUsingValueDecl*,
bool) (/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangSema.so.4+0x5b1122)
#12 0x00007ff44509d1f2 clang::Sema::InstantiateClass(clang::SourceLocation,
clang::CXXRecordDecl*, clang::CXXRecordDecl*,
clang::MultiLevelTemplateArgumentList const&,
clang::TemplateSpecializationKind, bool)
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangSema.so.4+0x5811f2)
#13 0x00007ff4450c5785
clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation,
clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind,
bool) (/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangSema.so.4+0x5a9785)
#14 0x00007ff4450fd6ab
clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType,
clang::Sema::TypeDiagnoser*)
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangSema.so.4+0x5e16ab)
#15 0x00007ff4450fd985 clang::Sema::RequireCompleteType(clang::SourceLocation,
clang::QualType, clang::Sema::TypeDiagnoser&)
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangSema.so.4+0x5e1985)
#16 0x00007ff444e783b6
clang::Sema::BuildCXXTypeConstructExpr(clang::TypeSourceInfo*,
clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>,
clang::SourceLocation)
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangSema.so.4+0x35c3b6)
#17 0x00007ff444e99d62
clang::Sema::ActOnCXXTypeConstructExpr(clang::OpaquePtr<clang::QualType>,
clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>,
clang::SourceLocation)
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangSema.so.4+0x37dd62)
#18 0x00007ff44540c077
clang::Parser::ParseCXXTypeConstructExpression(clang::DeclSpec const&)
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangParse.so.4+0x78077)
#19 0x00007ff4453fff82 clang::Parser::ParseCastExpression(bool, bool, bool&,
clang::Parser::TypeCastState)
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangParse.so.4+0x6bf82)
#20 0x00007ff445401a9d clang::Parser::ParseCastExpression(bool, bool,
clang::Parser::TypeCastState)
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangParse.so.4+0x6da9d)
#21 0x00007ff445401b39
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState)
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangParse.so.4+0x6db39)
#22 0x00007ff445401bb9
clang::Parser::ParseExpression(clang::Parser::TypeCastState)
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangParse.so.4+0x6dbb9)
#23 0x00007ff445442362 clang::Parser::ParseExprStatement()
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangParse.so.4+0xae362)
#24 0x00007ff445441097
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::AllowedContsructsKind, clang::SourceLocation*,
clang::Parser::ParsedAttributesWithRange&)
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangParse.so.4+0xad097)
#25 0x00007ff4454412bf
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::AllowedContsructsKind, clang::SourceLocation*)
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangParse.so.4+0xad2bf)
#26 0x00007ff4454448c9 clang::Parser::ParseCompoundStatementBody(bool)
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangParse.so.4+0xb08c9)
#27 0x00007ff445446f0f clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&)
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangParse.so.4+0xb2f0f)
#28 0x00007ff445462195
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangParse.so.4+0xce195)
#29 0x00007ff4453e0aeb clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
unsigned int, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangParse.so.4+0x4caeb)
#30 0x00007ff44545e84a
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangParse.so.4+0xca84a)
#31 0x00007ff44545eeb4
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangParse.so.4+0xcaeb4)
#32 0x00007ff44546386d
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangParse.so.4+0xcf86d)
#33 0x00007ff44546442e
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangParse.so.4+0xd042e)
#34 0x00007ff4453c1b3b clang::ParseAST(clang::Sema&, bool, bool)
(/usr/lib64/llvm/4/bin/../lib64/../lib64/libclangParse.so.4+0x2db3b)
#35 0x00007ff4476636d8 clang::CodeGenAction::ExecuteAction()
(/usr/lib64/llvm/4/bin/../lib64/libclangCodeGen.so.4+0x2866d8)
#36 0x00007ff4471be276 clang::FrontendAction::Execute()
(/usr/lib64/llvm/4/bin/../lib64/libclangFrontend.so.4+0xd1276)
#37 0x00007ff44718301e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/lib64/llvm/4/bin/../lib64/libclangFrontend.so.4+0x9601e)
#38 0x00007ff449e244a9
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/lib64/llvm/4/bin/../lib64/libclangFrontendTool.so.4+0x44a9)
#39 0x0000000000410a88 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/lib64/llvm/4/bin/clang-4.0+0x410a88)
#40 0x000000000040c13b main (/usr/lib64/llvm/4/bin/clang-4.0+0x40c13b)
#41 0x00007ff446b271e0 __libc_start_main (/lib64/libc.so.6+0x201e0)
#42 0x000000000040d5aa _start (/usr/lib64/llvm/4/bin/clang-4.0+0x40d5aa)
Stack dump:
0.      Program arguments: /usr/lib64/llvm/4/bin/clang-4.0 -cc1 -triple
x86_64-pc-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
main.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim
-fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables
-fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb
-resource-dir /usr/lib64/llvm/4/bin/../../../../lib/clang/4.0.0
-internal-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/g++-v5
-internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/g++-v5/x86_64-pc-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/g++-v5/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/lib64/llvm/4/bin/../../../../lib/clang/4.0.0/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-std=c++1z -fdeprecated-macro -fdebug-compilation-dir /home/david/test
-ferror-limit 19 -fmessage-length 105 -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
/tmp/main-26f2f3.o -x c++ source/main.cpp 
1.      source/main.cpp:10:23: current parser token ';'
2.      source/main.cpp:9:12: parsing function body 'main'
3.      source/main.cpp:9:12: in compound statement ('{}')
4.      source/main.cpp:5:8: instantiating class definition 'inherit<const
base>'
clang-4.0: error: unable to execute command: Aborted (core dumped)
clang-4.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 4.0.0 (tags/RELEASE_400/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin</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>