Richard Smith | f0e87cf | 2016-12-09 19:35:45 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-linux -std=c++98 %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call " |
| 2 | // RUN: %clang_cc1 -triple x86_64-linux -std=c++11 %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call " |
| 3 | // RUN: %clang_cc1 -triple x86_64-linux -std=c++14 %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call " |
| 4 | // RUN: %clang_cc1 -triple x86_64-linux -std=c++1z %s -pedantic-errors -emit-llvm -o - | FileCheck %s --implicit-check-not " call " |
| 5 | |
| 6 | // dr118: yes |
| 7 | |
| 8 | struct S { |
| 9 | virtual void f(); |
| 10 | }; |
| 11 | void (S::*pmf)(); |
| 12 | |
| 13 | // CHECK-LABEL: define {{.*}} @_Z1g |
| 14 | void g(S *sp) { |
| 15 | // CHECK: call void % |
| 16 | sp->f(); // 1: polymorphic |
| 17 | // CHECK: call void @ |
| 18 | sp->S::f(); // 2: non-polymorphic |
| 19 | // CHECK: call void @ |
| 20 | (sp->S::f)(); // 3: non-polymorphic |
| 21 | // CHECK: call void % |
| 22 | (sp->*pmf)(); // 4: polymorphic |
| 23 | // CHECK: call void % |
| 24 | (sp->*&S::f)(); // 5: polymorphic |
| 25 | } |
| 26 | |