This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/70435] section attribute of a function template is not honored.
- From: "armin at otheruse dot nl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 26 Jan 2017 11:27:40 +0000
- Subject: [Bug c++/70435] section attribute of a function template is not honored.
- Auto-submitted: auto-generated
- References: <bug-70435-4@http.gcc.gnu.org/bugzilla/>
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