https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70435
Armin van der Togt <armin at otheruse dot nl> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |armin at otheruse dot nl
--- Comment #1 from Armin van der Togt <armin at otheruse dot nl> ---
I am having the same problem with static member variables:
#include <sys/types.h>
class TestClassRegular {
public:
static volatile const int32_t regularVar;
};
volatile const int32_t TestClassRegular::regularVar __attribute__
((section(".eepromdata.ints"))) = 0;
template <uint32_t size, typename T>
class TestClassTemplate {
public:
static volatile const int32_t templateVar;
};
template <uint32_t size, typename T>
volatile const int32_t TestClassTemplate<size,T>::templateVar __attribute__
((section(".eepromdata.ints"))) = 0;
int main() {
int32_t blah = TestClassRegular::regularVar + TestClassTemplate<10,
uint8_t>::templateVar;
return blah;
}
arm-none-eabi-objdump -t stm32l0-Template.elf | grep Var
200000c4 w O .data 00000004 _ZN17TestClassTemplateILm10EhE11templateVarE
08080008 g O .eepromdata 00000004 _ZN16TestClassRegular10regularVarE