[llvm-bugs] [Bug 49148] New: Default template parameter value from brace-initialization

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Feb 11 06:48:00 PST 2021


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

            Bug ID: 49148
           Summary: Default template parameter value from
                    brace-initialization
           Product: clang
           Version: 11.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: tomaqa at gmail.com
                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

Clang does not allow brace-initialization in default value of template
parameter. I hope I used the right terminology.

Example:

template <int I = {}> void foo(int i = {});

error: expected expression

Default value of the function parameter is accepted, but the template one is
not.

I did not figure out whether this is covered in the standard, however I think
that the current state is inconsistent (is it alright for function, but not for
template).
(Works in GCC.)

-- 
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/20210211/fefe30fe/attachment-0001.html>


More information about the llvm-bugs mailing list