This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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++?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]