You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Martin Sebor (JIRA)" <ji...@apache.org> on 2006/06/27 22:27:30 UTC
[jira] Created: (STDCXX-207) [Sun C++] error referencing a static
symbol from a template
[Sun C++] error referencing a static symbol from a template
-----------------------------------------------------------
Key: STDCXX-207
URL: http://issues.apache.org/jira/browse/STDCXX-207
Project: C++ Standard Library
Type: Bug
Components: External
Environment: Sun C++
Reporter: Martin Sebor
This fails to compile with Sun C++ (all versions):
$ cat > t.cpp << EOF && CC -V t.cpp
static void foo () { }
template <class T>
void bar () { foo (); }
int main () { bar<int>(); }
EOF
CC: Sun C++ 5.7 DEV 2004/11/02
ccfe: Sun C++ 5.7 DEV 2004/11/02
"t.cpp", line 4: Error: The name foo() is unusable in bar<int>().
"t.cpp", line 6: Where: While instantiating "bar<int>()".
"t.cpp", line 6: Where: Instantiated from non-template code.
1 Error(s) detected.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (STDCXX-207) [Sun C++] error referencing a static
symbol from a template
Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/STDCXX-207?page=comments#action_12418110 ]
Martin Sebor commented on STDCXX-207:
-------------------------------------
This is a documented limitation of the compiler:
http://developers.sun.com/prodtech/cc/documentation/ss9_docs/mr/READMEs/c++.html#cUndefined
> [Sun C++] error referencing a static symbol from a template
> -----------------------------------------------------------
>
> Key: STDCXX-207
> URL: http://issues.apache.org/jira/browse/STDCXX-207
> Project: C++ Standard Library
> Type: Bug
> Components: External
> Environment: Sun C++
> Reporter: Martin Sebor
>
> This fails to compile with Sun C++ (all versions):
> $ cat > t.cpp << EOF && CC -V t.cpp
> static void foo () { }
> template <class T>
> void bar () { foo (); }
> int main () { bar<int>(); }
> EOF
> CC: Sun C++ 5.7 DEV 2004/11/02
> ccfe: Sun C++ 5.7 DEV 2004/11/02
> "t.cpp", line 4: Error: The name foo() is unusable in bar<int>().
> "t.cpp", line 6: Where: While instantiating "bar<int>()".
> "t.cpp", line 6: Where: Instantiated from non-template code.
> 1 Error(s) detected.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira