Can't use sizeof... to initialize struct template members
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- embedded-iot
Research direction
Start with the minimal InfoArray template in C:\Users\vhtmf\Documents\Arduino\sketch_nov5a\sketch_nov5a.ino and reproduce the reported compiler errors. Then inspect the Arduino SAM compilation toolchain's handling of C++ parameter packs; done means identifying the cause and documenting or resolving whether sizeof...(Ts) can initialize the member.
Written by the indexing model from the issue text.
Description
#include<stdint.h>
template<typename... Ts>
struct InfoArray {
uint8_t Number = sizeof...(Ts);
};
The code above does not compile.
C:\Users\vhtmf\Documents\Arduino\sketch_nov5a\sketch_nov5a.ino:4:20: error: expected ';' at end of member declaration
uint8_t Number = sizeof...(Ts);
^
C:\Users\vhtmf\Documents\Arduino\sketch_nov5a\sketch_nov5a.ino:4:26: error: expected unqualified-id before '...' token
uint8_t Number = sizeof...(Ts);
^
C:\Users\vhtmf\Documents\Arduino\sketch_nov5a\sketch_nov5a.ino:4:20: error: expected primary-expression at end of input
uint8_t Number = sizeof...(Ts);
^
exit status 1
Compilation error: expected ';' at end of member declaration
- Dominant language
- HTML
- Stars
- 91
- Forks
- 112
- PR merge metrics
- No merged PRs in 30d
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from arduino/ArduinoCore-sam
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
arduino/ArduinoCore-sam#129 ·
-
Type: Bug USB: CDC serial
Difficulty 4/5 3-5 days Newbie friendliness 52/100
arduino/ArduinoCore-sam#153 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
arduino/ArduinoCore-sam#147 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
arduino/ArduinoCore-sam#146 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
arduino/ArduinoCore-sam#145 ·
All issues in arduino/ArduinoCore-sam
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
tensorflow/tflite-micro#3784 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
zephyrproject-rtos/zephyr#120388 · 2 comments ·
Maintainers usually reply within 1 day
-
[Bug]: arm_barycenter_f16 fails to compile on MVE due to _Generic selector mismatch with _Float16Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ARM-software/CMSIS-DSP#351 ·
-
new device support
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Koenkk/zigbee2mqtt#33209 · 4 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
espressif/esp-hosted#765 ·