[llvm-bugs] [Bug 49411] New: local variables are allowed as default parameters in template list

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 3 08:00:32 PST 2021


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

            Bug ID: 49411
           Summary: local variables are allowed as default parameters in
                    template list
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hewillk at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

The following code accept by Clang:

auto f() {
  const auto x = 1;
  [] <auto y = x> {};
}

But local variables are not allowed as default parameters.

godbolt: https://godbolt.org/z/TzxT9z

-- 
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/20210303/cdbc2c9c/attachment-0001.html>


More information about the llvm-bugs mailing list