| 1 |
// RUN: %clang_cc1 -verify -fopenmp --std=c++20 -ast-print %s -Wsign-conversion | FileCheck %s |
| 2 |
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++20 -emit-pch -o %t %s |
| 3 |
// RUN: %clang_cc1 -fopenmp -std=c++20 -include-pch %t -verify %s -ast-print | FileCheck %s |
| 4 |
|
| 5 |
// RUN: %clang_cc1 -verify -fopenmp-simd --std=c++20 -ast-print %s -Wsign-conversion | FileCheck %s |
| 6 |
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++20 -emit-pch -o %t %s |
| 7 |
// RUN: %clang_cc1 -fopenmp-simd -std=c++20 -include-pch %t -verify %s -ast-print | FileCheck %s |
| 8 |
// expected-no-diagnostics |
| 9 |
|
| 10 |
#ifndef HEADER |
| 11 |
#define HEADER |
| 12 |
|
| 13 |
template <typename T> class iterator { |
| 14 |
public: |
| 15 |
T &operator*() const; |
| 16 |
iterator &operator++(); |
| 17 |
}; |
| 18 |
template <typename T> |
| 19 |
bool operator==(const iterator<T> &, const iterator<T> &); |
| 20 |
template <typename T> |
| 21 |
unsigned long operator-(const iterator<T> &, const iterator<T> &); |
| 22 |
template <typename T> |
| 23 |
iterator<T> operator+(const iterator<T> &, unsigned long); |
| 24 |
class vector { |
| 25 |
public: |
| 26 |
vector(); |
| 27 |
iterator<int> begin(); |
| 28 |
iterator<int> end(); |
| 29 |
}; |
| 30 |
// CHECK: void foo() { |
| 31 |
void foo() { |
| 32 |
// CHECK-NEXT: vector vec; |
| 33 |
vector vec; |
| 34 |
// CHECK-NEXT: #pragma omp for |
| 35 |
#pragma omp for |
| 36 |
// CHECK-NEXT: for (int i : vec) |
| 37 |
for (int i : vec) |
| 38 |
; |
| 39 |
} |
| 40 |
#endif |