[LLVMbugs] [Bug 19564] New: error: addition of default argument on redeclaration makes this constructor a default constructor

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 25 12:49:29 PDT 2014


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: unassignedclangbugs at nondot.org
          Reporter: mcrosier at codeaurora.org
                CC: apazos at codeaurora.org, dgregor at apple.com,
                    llvmbugs at cs.uiuc.edu, mcrosier at codeaurora.org,
                    t.p.northover at gmail.com
    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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140425/ff67fe0e/attachment.html>


More information about the llvm-bugs mailing list