1--- a/src/google/protobuf/compiler/cpp/message.cc 2+++ b/src/google/protobuf/compiler/cpp/message.cc 3@@ -1300,7 +1300,7 @@ void MessageGenerator::GenerateClassDefinition(io::Printer* printer) { 4 "friend void swap($classname$& a, $classname$& b) {\n" 5 " a.Swap(&b);\n" 6 "}\n" 7- "inline void Swap($classname$* other) {\n" 8+ "PROTOBUF_NOINLINE void Swap($classname$* other) {\n" 9 " if (other == this) return;\n" 10 " if (GetArena() == other->GetArena()) {\n" 11 " InternalSwap(other);\n" 12