[llvm-bugs] [Bug 39103] New: Template argument deduction of non-type template argument is foiled by parentheses

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 27 14:16:38 PDT 2018


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

            Bug ID: 39103
           Summary: Template argument deduction of non-type template
                    argument is foiled by parentheses
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: arthur.j.odwyer at gmail.com
                CC: llvm-bugs at lists.llvm.org

https://godbolt.org/z/3cQyN9

cat >test.cc <<EOF

template<int X> struct widget {};

template<int X> void foo(widget<(X)>) {}

void xyzzy() {
    foo<42>(widget<42>{});  // OK
    foo(widget<42>{});  // can't deduce X
}

EOF
clang++ -std=c++11 -c test.cc


test.cc:8:5: error: no matching function for call to 'foo'
    foo(widget<42>{});  // can't deduce X
    ^~~
test.cc:4:22: note: candidate template ignored: couldn't infer template
argument 'X'
template<int X> void foo(widget<(X)>) {}
                     ^
1 error generated.


GCC, ICC, and MSVC all disagree with Clang here.

-- 
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/20180927/24955df1/attachment.html>


More information about the llvm-bugs mailing list