diff options
Diffstat (limited to 'test/CXX/drs/dr118.cpp')
-rw-r--r-- | test/CXX/drs/dr118.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/CXX/drs/dr118.cpp b/test/CXX/drs/dr118.cpp new file mode 100644 index 000000000000..58aa3912c801 --- /dev/null +++ b/test/CXX/drs/dr118.cpp @@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -triple x86_64-linux -std=c++98 %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call " +// RUN: %clang_cc1 -triple x86_64-linux -std=c++11 %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call " +// RUN: %clang_cc1 -triple x86_64-linux -std=c++14 %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call " +// RUN: %clang_cc1 -triple x86_64-linux -std=c++1z %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call " + +// dr118: yes + +struct S { + virtual void f(); +}; +void (S::*pmf)(); + +// CHECK-LABEL: define {{.*}} @_Z1g +void g(S *sp) { + // CHECK: call void % + sp->f(); // 1: polymorphic + // CHECK: call void @ + sp->S::f(); // 2: non-polymorphic + // CHECK: call void @ + (sp->S::f)(); // 3: non-polymorphic + // CHECK: call void % + (sp->*pmf)(); // 4: polymorphic + // CHECK: call void % + (sp->*&S::f)(); // 5: polymorphic +} + |