[Bug c++/52036] C++11 allows template parameters to have internal linkage

benjamin at benkay dot net gcc-bugzilla@gcc.gnu.org
Sun Jan 29 17:27:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52036

--- Comment #3 from Benjamin Kay <benjamin at benkay dot net> 2012-01-29 16:24:29 UTC ---
Oops! You're quite right, pi is automatic in my test case. However compilation
still fails if pi is given internal linkage by declaring it static, i.e.

int main()
{
  static constexpr float pi = 3.14;

Or even:

namespace {
  static constexpr float pi = 3.14;
}
int main()
{

Can you provide an example of a variable with internal linkage being used as a
reference template parameter that compiles using g++?



More information about the Gcc-bugs mailing list