[llvm-bugs] [Bug 46637] New: fun with auto () -> auto

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 8 07:21:28 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46637

            Bug ID: 46637
           Summary: fun with auto () -> auto
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: zilla at kayari.org
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

template<auto (*)() -> auto> struct X { };
X<nullptr> x;

This compiles OK, unless you use -g, then you get:

Stack dump:
0.      Program arguments: /usr/bin/clang-9 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -discard-value-names -main-file-name 96110.C
-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 /tmp/96110.gcno -resource-dir
/usr/lib64/clang/9.0.1 -internal-isystem
/usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../include/c++/9
-internal-isystem
/usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../include/c++/9/x86_64-redhat-linux
-internal-isystem
/usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../include/c++/9/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/lib64/clang/9.0.1/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -fdeprecated-macro
-fdebug-compilation-dir /tmp -ferror-limit 19 -fmessage-length 0
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -faddrsig -o 96110.o -x c++ 96110.C 
1.      <eof> parser at end of file
2.      96110.C:2:12: LLVM IR generation of declaration 'x'
3.      96110.C:2:12: Generating code for declaration 'x'
/lib64/libLLVM-9.so(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamE+0x2e)[0x7fa33a48011e]
/lib64/libLLVM-9.so(_ZN4llvm3sys17RunSignalHandlersEv+0x34)[0x7fa33a47e014]
/lib64/libLLVM-9.so(+0xbb7195)[0x7fa33a47e195]
/lib64/libc.so.6(+0x3c6b0)[0x7fa3395276b0]
/lib64/libclang-cpp.so.9(+0x1703f16)[0x7fa33fd3df16]
/lib64/libclang-cpp.so.9(_ZN5clang7CodeGen11CGDebugInfo15getOrCreateTypeENS_8QualTypeEPN4llvm6DIFileE+0x42)[0x7fa33fd4e012]
/lib64/libclang-cpp.so.9(_ZN5clang7CodeGen11CGDebugInfo10CreateTypeEPKNS_12FunctionTypeEPN4llvm6DIFileE+0x57)[0x7fa33fd4f697]
/lib64/libclang-cpp.so.9(_ZN5clang7CodeGen11CGDebugInfo15getOrCreateTypeENS_8QualTypeEPN4llvm6DIFileE+0x8e)[0x7fa33fd4e05e]
/lib64/libclang-cpp.so.9(_ZN5clang7CodeGen11CGDebugInfo21CreatePointerLikeTypeEN4llvm5dwarf3TagEPKNS_4TypeENS_8QualTypeEPNS2_6DIFileE+0x104)[0x7fa33fd4ef64]
/lib64/libclang-cpp.so.9(_ZN5clang7CodeGen11CGDebugInfo15getOrCreateTypeENS_8QualTypeEPN4llvm6DIFileE+0x8e)[0x7fa33fd4e05e]
/lib64/libclang-cpp.so.9(_ZN5clang7CodeGen11CGDebugInfo21CollectTemplateParamsEPKNS_21TemplateParameterListEN4llvm8ArrayRefINS_16TemplateArgumentEEEPNS5_6DIFileE+0x496)[0x7fa33fd51a86]
/lib64/libclang-cpp.so.9(_ZN5clang7CodeGen11CGDebugInfo17CreateLimitedTypeEPKNS_10RecordTypeE+0x32b)[0x7fa33fd539cb]
/lib64/libclang-cpp.so.9(_ZN5clang7CodeGen11CGDebugInfo22getOrCreateLimitedTypeEPKNS_10RecordTypeEPN4llvm6DIFileE+0x12b)[0x7fa33fd53c5b]
/lib64/libclang-cpp.so.9(_ZN5clang7CodeGen11CGDebugInfo20CreateTypeDefinitionEPKNS_10RecordTypeE+0x55)[0x7fa33fd4d485]
/lib64/libclang-cpp.so.9(_ZN5clang7CodeGen11CGDebugInfo15getOrCreateTypeENS_8QualTypeEPN4llvm6DIFileE+0x8e)[0x7fa33fd4e05e]
/lib64/libclang-cpp.so.9(_ZN5clang7CodeGen11CGDebugInfo18EmitGlobalVariableEPN4llvm14GlobalVariableEPKNS_7VarDeclE+0x2cb)[0x7fa33fd5a94b]
/lib64/libclang-cpp.so.9(_ZN5clang7CodeGen13CodeGenModule23EmitGlobalVarDefinitionEPKNS_7VarDeclEb+0xb55)[0x7fa33ff781d5]
/lib64/libclang-cpp.so.9(_ZN5clang7CodeGen13CodeGenModule20EmitGlobalDefinitionENS_10GlobalDeclEPN4llvm11GlobalValueE+0x1d5)[0x7fa33ff83a65]
/lib64/libclang-cpp.so.9(_ZN5clang7CodeGen13CodeGenModule10EmitGlobalENS_10GlobalDeclE+0x553)[0x7fa33ff84093]
/lib64/libclang-cpp.so.9(_ZN5clang7CodeGen13CodeGenModule16EmitTopLevelDeclEPNS_4DeclE+0x15d)[0x7fa33ff89d1d]
/lib64/libclang-cpp.so.9(+0x19c2f1f)[0x7fa33fffcf1f]
/lib64/libclang-cpp.so.9(+0x18f9041)[0x7fa33ff33041]
/lib64/libclang-cpp.so.9(_ZN5clang8ParseASTERNS_4SemaEbb+0x1f4)[0x7fa33ef8ecf4]
/lib64/libclang-cpp.so.9(_ZN5clang13CodeGenAction13ExecuteActionEv+0x51)[0x7fa33ff38a01]
/lib64/libclang-cpp.so.9(_ZN5clang14FrontendAction7ExecuteEv+0xd1)[0x7fa34069cb31]
/lib64/libclang-cpp.so.9(_ZN5clang16CompilerInstance13ExecuteActionERNS_14FrontendActionE+0x1bb)[0x7fa3406533db]
/lib64/libclang-cpp.so.9(_ZN5clang25ExecuteCompilerInvocationEPNS_16CompilerInstanceE+0x738)[0x7fa340720a48]
/usr/bin/clang-9(_Z8cc1_mainN4llvm8ArrayRefIPKcEES2_Pv+0x86f)[0x55d6f3c5a9ff]
/usr/bin/clang-9(main+0x1ab6)[0x55d6f3c56466]
/lib64/libc.so.6(__libc_start_main+0xf3)[0x7fa3395121a3]
/usr/bin/clang-9(_start+0x2e)[0x55d6f3c56ffe]
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)
clang version 9.0.1 (Fedora 9.0.1-2.fc31)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang-9: note: diagnostic msg: PLEASE submit a bug report to  and include the
crash backtrace, preprocessed source, and associated run script.
clang-9: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-9: note: diagnostic msg: /tmp/96110-335ff3.cpp
clang-9: note: diagnostic msg: /tmp/96110-335ff3.sh
clang-9: note: diagnostic msg: 

********************

The run script it wants me to attach is:

# Crash reproducer for clang version 9.0.1 (Fedora 9.0.1-2.fc31)
# Driver args: "--driver-mode=g++" "96110.C" "-c" "-g"
# Original command:  "/usr/bin/clang-9" "-cc1" "-triple"
"x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free"
"-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "96110.C"
"-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" "/tmp/96110.gcno" "-resource-dir"
"/usr/lib64/clang/9.0.1" "-internal-isystem"
"/usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../include/c++/9"
"-internal-isystem"
"/usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../include/c++/9/x86_64-redhat-linux"
"-internal-isystem"
"/usr/bin/../lib/gcc/x86_64-redhat-linux/9/../../../../include/c++/9/backward"
"-internal-isystem" "/usr/local/include" "-internal-isystem"
"/usr/lib64/clang/9.0.1/include" "-internal-externc-isystem" "/include"
"-internal-externc-isystem" "/usr/include" "-fdeprecated-macro"
"-fdebug-compilation-dir" "/tmp" "-ferror-limit" "19" "-fmessage-length" "0"
"-fobjc-runtime=gcc" "-fcxx-exceptions" "-fexceptions"
"-fdiagnostics-show-option" "-fcolor-diagnostics" "-faddrsig" "-o" "96110.o"
"-x" "c++" "96110.C"
 "/usr/bin/clang-9" "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-emit-obj"
"-mrelax-all" "-disable-free" "-disable-llvm-verifier" "-discard-value-names"
"-main-file-name" "96110.C" "-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" "/tmp/96110.gcno"
"-fdeprecated-macro" "-ferror-limit" "19" "-fmessage-length" "0"
"-fobjc-runtime=gcc" "-fcxx-exceptions" "-fexceptions"
"-fdiagnostics-show-option" "-fcolor-diagnostics" "-faddrsig" "-x" "c++"
"96110-335ff3.cpp"

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200708/33ac20ce/attachment.html>


More information about the llvm-bugs mailing list