<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - error: addition of default argument on redeclaration makes this constructor a default constructor"
href="http://llvm.org/bugs/show_bug.cgi?id=19564">19564</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>error: addition of default argument on redeclaration makes this constructor a default constructor
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>mcrosier@codeaurora.org
</td>
</tr>
<tr>
<th>CC</th>
<td>apazos@codeaurora.org, dgregor@apple.com, llvmbugs@cs.uiuc.edu, mcrosier@codeaurora.org, t.p.northover@gmail.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>For the following test case:
class FOO {
public:
FOO(int);
int x;
};
FOO::FOO(int y = 0) : x(y) { }
The latest gcc-4.9 release compiles without error. However, ToT clang produces
an error.
$ clang-arm64-x++ -S foo.ii -w -o -
foo.ii:6:14: error: addition of default argument on redeclaration makes this
constructor a default constructor
FOO::FOO(int ii = 0) : i(ii) { }
^ ~
foo.ii:3:2: note: previous declaration is here
FOO(int);
^
1 error generated.
$ clang-arm64-x++ -S foo.ii -w -o - -###
clang version 3.5.0
Target: arm64-none-linux-gnu
Thread model: posix
"/home/mrosier/llvm-community/install/bin/clang-3.5" "-cc1" "-triple"
"arm64-none-linux-gnu" "-S" "-disable-free" "-main-file-name" "foo.ii"
"-mrelocation-model" "static" "-mdisable-fp-elim" "-fmath-errno"
"-masm-verbose" "-mconstructor-aliases" "-fuse-init-array" "-target-cpu"
"generic" "-target-feature" "+neon" "-target-abi" "aapcs" "-target-cpu"
"generic" "-coverage-file" "/home/mrosier/tmp/-" "-resource-dir"
"/home/mrosier/llvm-community/install/bin/../lib/clang/3.5.0" "-w"
"-fdeprecated-macro" "-fdebug-compilation-dir" "/home/mrosier/tmp"
"-ferror-limit" "19" "-fmessage-length" "262" "-mstackrealign"
"-fno-signed-char" "-fobjc-runtime=gcc" "-fcxx-exceptions" "-fexceptions"
"-fdiagnostics-show-option" "-fcolor-diagnostics" "-vectorize-slp" "-o" "-"
"-x" "c++-cpp-output" "foo.ii"</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>