PR22763: if a defaulted (non-user-provided) special member function is
explicitly instantiated, still emit it with each use. We don't emit a definition of the member with an explicit instantiation definition (and indeed it appears that we're not allowed to, since an explicit instantiation definition does not constitute an odr-use and only odr-use permits definition for defaulted special members). So we still need to emit a weak definition with each use. This also makes defaulted-in-class declarations behave more like implicitly-declared special members, which matches their design intent. And it matches the way this problem was solved in GCC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@318474 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/AST/DeclCXX.h 5 additions, 1 deletioninclude/clang/AST/DeclCXX.h
- lib/AST/ASTContext.cpp 6 additions, 0 deletionslib/AST/ASTContext.cpp
- test/CodeGenCXX/cxx11-special-members.cpp 3 additions, 1 deletiontest/CodeGenCXX/cxx11-special-members.cpp
- test/CodeGenCXX/explicit-instantiation.cpp 19 additions, 0 deletionstest/CodeGenCXX/explicit-instantiation.cpp
Loading
Please register or sign in to comment