http://llvm.org/bugs/show_bug.cgi?id=19564
Bug ID: 19564
Summary: error: addition of default argument on redeclaration
makes this constructor a default constructor
Product: clang
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected],
[email protected]
Classification: Unclassified
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"
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs