This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52036] C++11 allows template parameters to have internal linkage
- From: "benjamin at benkay dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 29 Jan 2012 16:24:29 +0000
- Subject: [Bug c++/52036] C++11 allows template parameters to have internal linkage
- Auto-submitted: auto-generated
- References: <bug-52036-4@http.gcc.gnu.org/bugzilla/>
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++?