View | Details | Raw Unified | Return to bug 281486
Collapse All | Expand All

(-)b/devel/llvm13/files/patch-backport-7bc7672925 (+61 lines)
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/runtime/reduction-templates.h.orig	2022-06-22 16:46:24 UTC
34
+++ flang/runtime/reduction-templates.h
35
@@ -86,7 +86,7 @@ inline CppTypeFor<CAT, KIND> GetTotalReduction(const D
36
 #ifdef _MSC_VER // work around MSVC spurious error
37
   accumulator.GetResult(&result);
38
 #else
39
-  accumulator.template GetResult(&result);
40
+  accumulator.template GetResult<CppType>(&result);
41
 #endif
42
   return result;
43
 }
44
@@ -127,7 +127,7 @@ inline void ReduceDimToScalar(const Descriptor &x, int
45
 #ifdef _MSC_VER // work around MSVC spurious error
46
   accumulator.GetResult(result, zeroBasedDim);
47
 #else
48
-  accumulator.template GetResult(result, zeroBasedDim);
49
+  accumulator.template GetResult<TYPE>(result, zeroBasedDim);
50
 #endif
51
 }
52
 
53
@@ -155,7 +155,7 @@ inline void ReduceDimMaskToScalar(const Descriptor &x,
54
 #ifdef _MSC_VER // work around MSVC spurious error
55
   accumulator.GetResult(result, zeroBasedDim);
56
 #else
57
-  accumulator.template GetResult(result, zeroBasedDim);
58
+  accumulator.template GetResult<TYPE>(result, zeroBasedDim);
59
 #endif
60
 }
61
 

Return to bug 281486