Skip to content

Commit d35e6e4

Browse files
committed
chromium: [PATCH] pdfium: Fix missing function argument
Fix the following compilation error: ``` | ../../pdf/pdfium/pdfium_api_wrappers.cc:150:32: error: alias template 'PDFiumAPIStringBufferAdapter' requires template arguments; argument deduction only allowed for class templates | 150 | PDFiumAPIStringBufferAdapter adapter(&name, expected_size, | | ^ | ../../pdf/pdfium/pdfium_api_string_buffer_adapter.h:173:1: note: template is declared here | 173 | using PDFiumAPIStringBufferAdapter = | | ^ | 1 error generated. ``` This patch will be dropped once clang >= 19.1.0 is available, which includes support for class template argument deduction (CTAD) for type alias templates (P1814R0 [0]) (#54051 [1]). Note that currently meta-clang [2] provides the clang version `18.1.6`. [0] https://wg21.link/p1814r0 [1] llvm/llvm-project#54051 [2] https://github.com/kraj/meta-clang Signed-off-by: Ariel D'Alessandro <[email protected]>
1 parent 7204798 commit d35e6e4

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

meta-chromium/recipes-browser/chromium/chromium-gn.inc

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ SRC_URI += "\
2828
file://0011-Disable-crabbyavif-to-fix-build-errors.patch \
2929
file://0012-Revert-Allow-and-use-std-hardware_destructive_interf.patch \
3030
file://0013-Revert-Set-Rust-symbol-visibility-to-hidden-when-C-s.patch \
31+
file://0014-pdfium-Fix-missing-PDFiumAPIStringBufferAdapter-temp.patch \
3132
"
3233
# ARM/AArch64-specific patches.
3334
SRC_URI:append:aarch64 = "${@bb.utils.contains('TUNE_FEATURES', 'crypto', '', ' file://arm/0001-Fix-AES-crypto-SIGILL-on-rpi4-64.patch', d)}"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
From 20deec0782b78d1c8302764e852ff174f7a4f564 Mon Sep 17 00:00:00 2001
2+
From: Ariel D'Alessandro <[email protected]>
3+
Date: Fri, 15 Nov 2024 00:49:27 -0300
4+
Subject: [PATCH] pdfium: Fix missing PDFiumAPIStringBufferAdapter template
5+
argument
6+
7+
Fix the following compilation error:
8+
9+
```
10+
| ../../pdf/pdfium/pdfium_api_wrappers.cc:150:32: error: alias template
11+
'PDFiumAPIStringBufferAdapter' requires template arguments; argument
12+
deduction only allowed for class templates
13+
| 150 | PDFiumAPIStringBufferAdapter adapter(&name, expected_size,
14+
| | ^
15+
| ../../pdf/pdfium/pdfium_api_string_buffer_adapter.h:173:1: note: template
16+
is declared here
17+
| 173 | using PDFiumAPIStringBufferAdapter =
18+
| | ^
19+
| 1 error generated.
20+
```
21+
22+
This patch will be dropped once clang >= 19.1.0 is available, which
23+
includes support for class template argument deduction (CTAD) for type
24+
alias templates (P1814R0 [0]) (#54051 [1]).
25+
26+
Note that currently meta-clang [2] provides the clang version `18.1.6`.
27+
28+
[0] https://wg21.link/p1814r0
29+
[1] https://github.com/llvm/llvm-project/issues/54051
30+
[2] https://github.com/kraj/meta-clang
31+
32+
Upstream-Status: Inappropriate [specific to older versions of clang]
33+
Signed-off-by: Ariel D'Alessandro <[email protected]>
34+
---
35+
pdf/pdfium/pdfium_api_wrappers.cc | 2 +-
36+
1 file changed, 1 insertion(+), 1 deletion(-)
37+
38+
diff --git a/pdf/pdfium/pdfium_api_wrappers.cc b/pdf/pdfium/pdfium_api_wrappers.cc
39+
index b13fe20875e61..60c973b7152ab 100644
40+
--- a/pdf/pdfium/pdfium_api_wrappers.cc
41+
+++ b/pdf/pdfium/pdfium_api_wrappers.cc
42+
@@ -147,7 +147,7 @@ std::u16string GetPageObjectMarkName(FPDF_PAGEOBJECTMARK mark) {
43+
44+
// Number of characters, including the NUL.
45+
const size_t expected_size = base::checked_cast<size_t>(buflen_bytes / 2);
46+
- PDFiumAPIStringBufferAdapter adapter(&name, expected_size,
47+
+ PDFiumAPIStringBufferAdapter<std::u16string> adapter(&name, expected_size,
48+
/*check_expected_size=*/true);
49+
unsigned long actual_buflen_bytes = 0; // NOLINT(runtime/int)
50+
bool result =

0 commit comments

Comments
 (0)