[llvm-bugs] [Bug 23029] [cwg777] Diagnostic issued for function parameter pack following a default argument

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Feb 25 15:08:06 PST 2016


ThePhD <b762215 at trbvn.com> changed:

           What    |Removed                     |Added
             Status|RESOLVED                    |REOPENED
                 CC|                            |b762215 at trbvn.com
         Resolution|FIXED                       |---

--- Comment #3 from ThePhD <b762215 at trbvn.com> ---
This bug is still not fixed by the mentioned revision. When you actually use
the parameter pack, the old error rears its ugly head again. Minimal repro:

template <typename... Args>
void bark( int = 0, Args&&... args ) {}

int main ( int, char*[]) {
     bark(); // fine
     bark(1); // fine
     bark(1, 2); // boom
     return 0;

Given output:
main.cpp:2:31: error: missing default argument on parameter 'args'
void bark( int = 0, Args&&... args ) {}
main.cpp:7:6: note: in instantiation of function template specialization
'bark<int>' requested here
     bark(1, 2);
1 error generated.

Successful compilation.

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/20160225/8e8db2b1/attachment.html>

More information about the llvm-bugs mailing list