| Issue |
234734
|
| Summary |
Type deduction of a constexpr static member variable template in a template class failure and crash on its sizeof since 9.0.0
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
Pawday
|
```c++
template <typename T0>
struct Meta
{
template <typename T1>
static constexpr auto V = T1{};
};
using Meta_int_V_int_t = decltype(Meta<int>::template V<int>); // aka 'const auto' 🤔
Meta_int_V_int_t a;
static_assert(sizeof(Meta_int_V_int_t) == sizeof(int), "");
```
>From [compiler explorer](https://godbolt.org/z/vzzqWWMbv)
```
<source>:10:18: error: default initialization of an object of const type 'Meta_int_V_int_t' (aka 'const auto')
```
```
Stack dump:
0. Program arguments: /cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9 -cc1 -triple x86_64-unknown-linux-gnu -S -disable-free -disable-llvm-verifier -discard-value-names -main-file-name example.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 -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -coverage-notes-file /app/output.gcno -resource-dir /cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/lib/clang/9.0.0 -internal-isystem /opt/compiler-explorer/gcc-9.3.0/lib/gcc/x86_64-linux-gnu/9.3.0/../../../../include/c++/9.3.0 -internal-isystem /opt/compiler-explorer/gcc-9.3.0/lib/gcc/x86_64-linux-gnu/9.3.0/../../../../include/c++/9.3.0/x86_64-linux-gnu -internal-isystem /opt/compiler-explorer/gcc-9.3.0/lib/gcc/x86_64-linux-gnu/9.3.0/../../../../include/c++/9.3.0/backward -internal-isystem /usr/local/include -internal-isystem /cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/lib/clang/9.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -std=c++14 -fdeprecated-macro -fdebug-compilation-dir /app -ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -mllvm --x86-asm-syntax=intel -faddrsig -o /app/output.s -x c++ <source>
1. <eof> parser at end of file
#0 0x0000649825bdb76a llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x27db76a)
#1 0x0000649825bd9524 llvm::sys::RunSignalHandlers() (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x27d9524)
#2 0x0000649825bd9662 SignalHandler(int) (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x27d9662)
#3 0x00007e37f4e45330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
#4 0x0000649827918f08 clang::ASTContext::getTypeInfoImpl(clang::Type const*) const (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x4518f08)
#5 0x000064982790f2c5 clang::ASTContext::getTypeInfo(clang::Type const*) const (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x450f2c5)
#6 0x000064982790f2c5 clang::ASTContext::getTypeInfo(clang::Type const*) const (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x450f2c5)
#7 0x000064982791901b clang::ASTContext::getTypeInfoImpl(clang::Type const*) const (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x451901b)
#8 0x000064982790f2c5 clang::ASTContext::getTypeInfo(clang::Type const*) const (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x450f2c5)
#9 0x0000649827915ce5 clang::ASTContext::getTypeInfoInChars(clang::Type const*) const (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x4515ce5)
#10 0x0000649827915df9 clang::ASTContext::getTypeSizeInChars(clang::QualType) const (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x4515df9)
#11 0x0000649827a4f6d1 HandleSizeof((anonymous namespace)::EvalInfo&, clang::SourceLocation, clang::QualType, clang::CharUnits&) (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x464f6d1)
#12 0x0000649827a7d922 clang::StmtVisitorBase<llvm::make_const_ptr, (anonymous namespace)::IntExprEvaluator, bool>::Visit(clang::Stmt const*) (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x467d922)
#13 0x0000649827a6527d Evaluate(clang::APValue&, (anonymous namespace)::EvalInfo&, clang::Expr const*) (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x466527d)
#14 0x0000649827a7a6ea (anonymous namespace)::IntExprEvaluator::VisitBinaryOperator(clang::BinaryOperator const*) (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x467a6ea)
#15 0x0000649827a7c283 clang::StmtVisitorBase<llvm::make_const_ptr, (anonymous namespace)::IntExprEvaluator, bool>::Visit(clang::Stmt const*) (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x467c283)
#16 0x0000649827a6527d Evaluate(clang::APValue&, (anonymous namespace)::EvalInfo&, clang::Expr const*) (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x466527d)
#17 0x0000649827a68f51 EvaluateAsRValue((anonymous namespace)::EvalInfo&, clang::Expr const*, clang::APValue&) (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x4668f51)
#18 0x0000649827a6b570 clang::Expr::EvaluateAsRValue(clang::Expr::EvalResult&, clang::ASTContext const&, bool) const (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x466b570)
#19 0x0000649827439752 clang::Sema::VerifyIntegerConstantExpression(clang::Expr*, llvm::APSInt*, clang::Sema::VerifyICEDiagnoser&, bool) (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x4039752)
#20 0x0000649827439f66 clang::Sema::VerifyIntegerConstantExpression(clang::Expr*, llvm::APSInt*, unsigned int, bool) (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x4039f66)
#21 0x000064982739d325 clang::Sema::BuildStaticAssertDeclaration(clang::SourceLocation, clang::Expr*, clang::StringLiteral*, clang::SourceLocation, bool) (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x3f9d325)
#22 0x000064982713bc9c clang::Parser::ParseStaticAssertDeclaration(clang::SourceLocation&) (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x3d3bc9c)
#23 0x0000649827133340 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x3d33340)
#24 0x000064982711143a clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x3d1143a)
#25 0x0000649827111e79 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool) (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x3d11e79)
#26 0x0000649827105c69 clang::ParseAST(clang::Sema&, bool, bool) (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x3d05c69)
#27 0x0000649826930a47 clang::CodeGenAction::ExecuteAction() (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x3530a47)
#28 0x00006498262ac529 clang::FrontendAction::Execute() (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x2eac529)
#29 0x000064982626fbf5 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x2e6fbf5)
#30 0x000064982636ff23 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0x2f6ff23)
#31 0x000064982410e140 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0xd0e140)
#32 0x000064982406c882 main (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0xc6c882)
#33 0x00007e37f4e2a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#34 0x00007e37f4e2a28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#35 0x000064982410b7fa _start (/cefs/f0/f03e5f34867580d0ae719b6e_consolidated/compilers_c++_clang_9.0.0/bin/clang-9+0xd0b7fa)
clang-9: error: unable to execute command: Segmentation fault (core dumped)
clang-9: error: clang frontend command failed due to signal (use -v to see invocation)
Compiler returned: 254
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs