[cfe-commits] r161243 - in /cfe/trunk: lib/AST/RecordLayoutBuilder.cpp test/CodeGenCXX/cxx11-vtable-key-function.cpp
Benjamin Kramer
benny.kra at googlemail.com
Fri Aug 3 08:43:22 PDT 2012
Author: d0k
Date: Fri Aug 3 10:43:22 2012
New Revision: 161243
URL: http://llvm.org/viewvc/llvm-project?rev=161243&view=rev
Log:
Flesh out test for defaulted key functions a bit more.
Modified:
cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
cfe/trunk/test/CodeGenCXX/cxx11-vtable-key-function.cpp
Modified: cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/RecordLayoutBuilder.cpp?rev=161243&r1=161242&r2=161243&view=diff
==============================================================================
--- cfe/trunk/lib/AST/RecordLayoutBuilder.cpp (original)
+++ cfe/trunk/lib/AST/RecordLayoutBuilder.cpp Fri Aug 3 10:43:22 2012
@@ -2351,6 +2351,7 @@
if (MD->hasInlineBody())
continue;
+ // Ignore inline deleted or defaulted functions.
if (!MD->isUserProvided())
continue;
Modified: cfe/trunk/test/CodeGenCXX/cxx11-vtable-key-function.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/cxx11-vtable-key-function.cpp?rev=161243&r1=161242&r2=161243&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/cxx11-vtable-key-function.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/cxx11-vtable-key-function.cpp Fri Aug 3 10:43:22 2012
@@ -1,11 +1,38 @@
// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - -std=c++11 | FileCheck %s
// PR13424
+namespace Test1 {
struct X {
- virtual ~X() = default;
- virtual void f();
+ virtual ~X(); // Key function.
+ virtual void f(); // Not a key function.
+};
+
+X::~X() = default;
+
+// Verify that the vtable is emitted.
+// CHECK: @_ZTVN5Test11XE = unnamed_addr constant
+}
+
+namespace Test2 {
+struct X {
+ virtual ~X() = default; // Not a key function.
+ virtual void f(); // Key function.
+};
+
+void X::f() {}
+
+// Verify that the vtable is emitted.
+// CHECK: @_ZTVN5Test21XE = unnamed_addr constant
+}
+
+namespace Test3 {
+struct X {
+ virtual ~X() = delete; // Not a key function.
+ virtual void f(); // Key function.
};
void X::f() {}
-// CHECK: @_ZTV1X = unnamed_addr constant
+// Verify that the vtable is emitted.
+// CHECK: @_ZTVN5Test31XE = unnamed_addr constant
+}
More information about the cfe-commits
mailing list