[Bug c++/70435] section attribute of a function template is not honored.

2017-01-26 Thread armin at otheruse dot nl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70435

Armin van der Togt  changed:

   What|Removed |Added

 CC||armin at otheruse dot nl

--- Comment #1 from Armin van der Togt  ---

I am having the same problem with static member variables:

#include 

class TestClassRegular {
public:
static volatile const int32_t regularVar;
};
volatile const int32_t TestClassRegular::regularVar __attribute__
((section(".eepromdata.ints"))) = 0;

template 
class TestClassTemplate {
public:
static volatile const int32_t templateVar;
};

template 
volatile const int32_t TestClassTemplate::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
20c4  wO .data  0004 _ZN17TestClassTemplateILm10EhE11templateVarE
08080008 g O .eepromdata0004 _ZN16TestClassRegular10regularVarE

[Bug c++/70435] section attribute of a function template is not honored.

2017-04-08 Thread armin at otheruse dot nl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70435

--- Comment #2 from Armin van der Togt  ---
Problem is still present in version 6.3.1