[Bug c++/109126] [DR2387] Linkage of const-qualified variable template

2024-09-20 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109126 --- Comment #12 from Jonathan Wakely --- Yes but for the function template case if I want to use it in constexpr I add 'constexpr' and it's implicitly inline. For the variable template specialisation it's already constexpr, and I can't define it

[Bug c++/109126] [DR2387] Linkage of const-qualified variable template

2024-09-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109126 --- Comment #11 from Jakub Jelinek --- And template int foo (void) { return N; } template <> int foo <42> (void) { return -42; } int a = foo<15> (); int b = foo<42> (); works the same, _Z3fooILi15EEiv is comdat exported weak, _Z3fooILi42EEiv is

[Bug c++/109126] [DR2387] Linkage of const-qualified variable template

2024-09-20 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109126 --- Comment #10 from Jonathan Wakely --- (In reply to Jakub Jelinek from comment #8) > So the DR just turns the same for const/constexpr variable templates and > their specializations too. Yeah, I guess it's consistent.

[Bug c++/109126] [DR2387] Linkage of const-qualified variable template

2024-09-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109126 Jakub Jelinek changed: What|Removed |Added CC||jason at gcc dot gnu.org --- Comment #9

[Bug c++/109126] [DR2387] Linkage of const-qualified variable template

2024-09-20 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109126 --- Comment #8 from Jakub Jelinek --- Is there a reason why this should be treated any differently from non-const variable templates and their explicit specializations? If I try template bool var = true; template<> bool var = false; bool *p = &v

[Bug c++/109126] [DR2387] Linkage of const-qualified variable template

2024-09-20 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109126 --- Comment #7 from Andrew Pinski --- (In reply to Jonathan Wakely from comment #6) > It looks like explicit specializations are not given vague linkage. Is that > the correct behaviour? I wonder if that is related to PR 116746 .

[Bug c++/109126] [DR2387] Linkage of const-qualified variable template

2024-09-20 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109126 --- Comment #6 from Jonathan Wakely --- It looks like explicit specializations are not given vague linkage. Is that the correct behaviour? /usr/bin/ld: /tmp/ccjbP7xI.o:/tmp/t.h:2: multiple definition of `var'; /tmp/ccMCRAVO.o:/tmp/t.h:2: first

[Bug c++/109126] [DR2387] Linkage of const-qualified variable template

2024-08-07 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109126 Jakub Jelinek changed: What|Removed |Added Resolution|--- |FIXED Status|ASSIGNED

[Bug c++/109126] [DR2387] Linkage of const-qualified variable template

2024-08-07 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109126 --- Comment #4 from GCC Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:82cd63a63eaa61a4ed5c4029a1869be7446ecb3c commit r15-2798-g82cd63a63eaa61a4ed5c4029a1869be7446ecb3c Author: Jakub Jelinek Date: W

[Bug c++/109126] [DR2387] Linkage of const-qualified variable template

2024-08-07 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109126 Jakub Jelinek changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org

[Bug c++/109126] [DR2387] Linkage of const-qualified variable template

2024-07-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109126 Andrew Pinski changed: What|Removed |Added Ever confirmed|0 |1 Status|UNCONFIRMED

[Bug c++/109126] [DR2387] Linkage of const-qualified variable template

2024-07-24 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109126 Andrew Pinski changed: What|Removed |Added CC||de34 at live dot cn --- Comment #1 from