[LLVMbugs] [Bug 10618] New: "addition of default argument makes this a special member" warning slightly incorrect with multiple default arguments

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Aug 9 09:45:12 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=10618

           Summary: "addition of default argument makes this a special
                    member" warning slightly incorrect with multiple
                    default arguments
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: richard-llvm at metafoo.co.uk
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


In the following case, we get a warning for all three default arguments,
whereas we should only be warned about 'a' (the others don't make S::S a
special member function):

struct S { S(int, int, int); }; S::S(int a = 0, int b = 0, int c = 0) {}


In the following case, we get a warning for both arguments (correctly) but the
warning for the second default argument incorrectly claims that it makes S::S a
default constructor (it actually makes it a copy constructor):

struct S { S(const S&, int); S(int); }; S::S(const S& = S(0), int = 0) {}


=> We should only produce a warning on the default argument which makes the
member special (for default constructors, the default argument for the first
parameter, and for everything else, the default argument for the second
parameter). And we should make sure we correctly handle the case where both
happen in the same definition.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list