https://bugs.llvm.org/show_bug.cgi?id=28816

John Brawn <john.br...@arm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED

--- Comment #1 from John Brawn <john.br...@arm.com> ---
"template<int n> int var" is actually a definition of a template variable (with
an implicit initialization to zero), so the compiler's behaviour here is fine.
If you do "template<int n> extern int var" then that _is_ a declaration, and in
that case we get the error

tmp.cpp:2:14: error: explicit instantiation of undefined variable template
'var<0>'
template int var<0>;
             ^
tmp.cpp:1:28: note: explicit instantiation refers here
template<int n> extern int var;
                           ^
1 error generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to