Added
Link Here
|
1 |
From 7bc7672925f8154be3b8220365d3f269ac43621c Mon Sep 17 00:00:00 2001 |
2 |
From: David Spickett <david.spickett@linaro.org> |
3 |
Date: Mon, 3 Jun 2024 15:21:26 +0100 |
4 |
Subject: [PATCH] [flang] Fix compilation errors due to new clang template |
5 |
requirements (#94204) |
6 |
|
7 |
Since https://github.com/llvm/llvm-project/pull/80801 clang requires a |
8 |
template argument list after the use of the template keyword. |
9 |
|
10 |
https://lab.llvm.org/buildbot/#/builders/176/builds/10230 |
11 |
|
12 |
error: a template argument list is expected after a name prefixed by the |
13 |
template keyword [-Wmissing-template-arg-list-after-template-kw] |
14 |
|
15 |
This fixes the instances found by the AArch64 Linux builds. |
16 |
--- |
17 |
flang/include/flang/Evaluate/integer.h | 2 +- |
18 |
flang/lib/Evaluate/fold-real.cpp | 7 ++++--- |
19 |
flang/runtime/reduction-templates.h | 8 ++++---- |
20 |
3 files changed, 9 insertions(+), 8 deletions(-) |
21 |
|
22 |
--- flang/include/flang/Evaluate/integer.h.orig 2022-06-22 16:46:24 UTC |
23 |
+++ flang/include/flang/Evaluate/integer.h |
24 |
@@ -307,7 +307,7 @@ class Integer { (public) |
25 |
} |
26 |
result.overflow = false; |
27 |
} else if constexpr (bits < FROM::bits) { |
28 |
- auto back{FROM::template ConvertSigned(result.value)}; |
29 |
+ auto back{FROM::template ConvertSigned<Integer>(result.value)}; |
30 |
result.overflow = back.value.CompareUnsigned(that) != Ordering::Equal; |
31 |
} |
32 |
return result; |
33 |
--- flang/lib/Evaluate/fold-real.cpp.orig 2022-06-22 16:46:24 UTC |
34 |
+++ flang/lib/Evaluate/fold-real.cpp |
35 |
@@ -145,7 +145,7 @@ Expr<Type<TypeCategory::Real, KIND>> FoldIntrinsicFunc |
36 |
#ifndef _MSC_VER |
37 |
template |
38 |
#endif |
39 |
- SCALE(y)}; |
40 |
+ SCALE<Scalar<TBY>>(y)}; |
41 |
if (result.flags.test(RealFlag::Overflow)) { |
42 |
context.messages().Say( |
43 |
"SCALE intrinsic folding overflow"_en_US); |
44 |
--- flang/runtime/reduction-templates.h.orig 2022-06-22 16:46:24 UTC |
45 |
+++ flang/runtime/reduction-templates.h |
46 |
@@ -86,7 +86,7 @@ inline CppTypeFor<CAT, KIND> GetTotalReduction(const D |
47 |
#ifdef _MSC_VER // work around MSVC spurious error |
48 |
accumulator.GetResult(&result); |
49 |
#else |
50 |
- accumulator.template GetResult(&result); |
51 |
+ accumulator.template GetResult<CppType>(&result); |
52 |
#endif |
53 |
return result; |
54 |
} |
55 |
@@ -127,7 +127,7 @@ inline void ReduceDimToScalar(const Descriptor &x, int |
56 |
#ifdef _MSC_VER // work around MSVC spurious error |
57 |
accumulator.GetResult(result, zeroBasedDim); |
58 |
#else |
59 |
- accumulator.template GetResult(result, zeroBasedDim); |
60 |
+ accumulator.template GetResult<TYPE>(result, zeroBasedDim); |
61 |
#endif |
62 |
} |
63 |
|
64 |
@@ -155,7 +155,7 @@ inline void ReduceDimMaskToScalar(const Descriptor &x, |
65 |
#ifdef _MSC_VER // work around MSVC spurious error |
66 |
accumulator.GetResult(result, zeroBasedDim); |
67 |
#else |
68 |
- accumulator.template GetResult(result, zeroBasedDim); |
69 |
+ accumulator.template GetResult<TYPE>(result, zeroBasedDim); |
70 |
#endif |
71 |
} |
72 |
|