https://llvm.org/bugs/show_bug.cgi?id=27671

            Bug ID: 27671
           Summary: Clang reports copy constructor being implicitly
                    deleted when it's not called in C++11 mode
           Product: clang
           Version: 3.5
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangb...@nondot.org
          Reporter: wanying...@gmail.com
                CC: dgre...@apple.com, llvm-bugs@lists.llvm.org,
                    sig-rnd-sat-clang-b...@synopsys.com
    Classification: Unclassified

The following code compiles successfully in Clang 3.4 and GCC 5.2. Clang 3.5
and higher issues an error in C++11 mode.

$ cat test.cpp
struct Base
{
  Base();
private:
  Base(const Base&);
};
struct D: public Base
{
  D(char*) {}
};
void func() {
  (void)new D("");
}

$ /opt/pkg/gcc-5.2.0/bin/g++ -c -w -std=c++11 test.cpp

$ /opt/pkg/clang-3.4/bin/clang -c -w -std=c++11 test.cpp

$ /opt/pkg/clang-3.5.0/bin/clang -c -w test.cpp

$ /opt/pkg/clang-3.5.0/bin/clang -c -w -std=c++11 test.cpp
test.cpp:12:13: error: call to implicitly-deleted copy constructor of 'D'
  (void)new D("");
            ^ ~~
test.cpp:7:11: note: copy constructor of 'D' is implicitly deleted because base
class 'Base' has an
      inaccessible copy constructor
struct D: public Base
          ^
1 error generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to