Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

candidate template ignored: substitution failure [with U = float]: variable length array cannot be formed during template argument deduction #50611

Open Quuxplusone opened 3 years ago

Quuxplusone commented 3 years ago
Bugzilla Link PR51644
Status NEW
Importance P enhancement
Reported by Yuri (yuri@tsoft.com)
Reported on 2021-08-27 02:31:48 -0700
Last modified on 2021-08-27 02:31:48 -0700
Version 11.0
Hardware PC FreeBSD
CC blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
Fixed by commit(s)
Attachments c++test.cpp (319 bytes, text/x-c++src)
Blocks
Blocked by
See also
Created attachment 25196
c++test.cpp

The attached testcase fails:

c++test.cpp:16:12: error: no matching member function for call to 'mmm'
        return ph.mmm(data, 10);
               ~~~^~~
c++test.cpp:10:14: note: candidate template ignored: substitution failure [with
U = float]: variable length array cannot be formed during template argument
deduction
    inline U mmm(U data[(1U<<IntBits)+1], unsigned int mask) const {
             ^         ~
c++test.cpp:10:28: warning: shift count >= width of type [-Wshift-count-
overflow]
    inline U mmm(U data[(1U<<IntBits)+1], unsigned int mask) const {
                           ^ ~~~~~~~
1 warning and 1 error generated.
[yuri@yv /disk-samsung/freebsd-ports/audio/calf-lv2]$ c++ -std=c++11 -c
c++test.cpp
c++test.cpp:16:12: error: no matching member function for call to 'mmm'
        return ph.mmm(data, 10);
               ~~~^~~
c++test.cpp:10:14: note: candidate template ignored: substitution failure [with
U = float]: variable length array cannot be formed during template argument
deduction
    inline U mmm(U data[(1U<<IntBits)+1], unsigned int mask) const {
             ^         ~
c++test.cpp:10:28: warning: shift count >= width of type [-Wshift-count-
overflow]
    inline U mmm(U data[(1U<<IntBits)+1], unsigned int mask) const {
                           ^ ~~~~~~~
1 warning and 1 error generated.

clang-11
FreeBSD 13
Quuxplusone commented 3 years ago

Attached c++test.cpp (319 bytes, text/x-c++src): c++test.cpp