[LLVMbugs] [Bug 8479] New: clang evaluates visibility of default parameters at the call site instead of at parameter definition site

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Oct 27 09:14:13 PDT 2010


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

           Summary: clang evaluates visibility of default parameters at
                    the call site instead of at parameter definition site
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nicolasweber at gmx.de
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


#include <vector>

class C {
public:
 explicit C(int x) {}

private:
 friend class std::vector<C>;
 C();
};

void f() {
 std::vector<C> vec;
 vec.resize(10);
}


$ g++ -c private-ctor.cc
# no errors

$ clang++ -c private-ctor.cc
In file included from private-ctor.cc:1:
In file included from /usr/include/c++/4.4/vector:64:
/usr/include/c++/4.4/bits/stl_vector.h:552:53: error: calling a
private constructor of class 'C'
     resize(size_type __new_size, value_type __x = value_type())
                                                   ^
private-ctor.cc:14:3: note: in instantiation of default function
argument expression for 'resize<C, std::allocator<C> >' required here
 vec.resize(10);
 ^
private-ctor.cc:9:3: note: declared private here
 C();
 ^

-- 
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