Summary: | UIPMC_Transport.cpp violates C++ ODR | ||
---|---|---|---|
Product: | TAO | Reporter: | J.T. Conklin <jtc> |
Component: | PortableGroup | Assignee: | DOC Center Support List (internal) <tao-support> |
Status: | NEW --- | ||
Severity: | normal | CC: | gbr |
Priority: | P3 | ||
Version: | 1.6.1 | ||
Hardware: | x86 | ||
OS: | Solaris | ||
Bug Depends on: | |||
Bug Blocks: | 3160 |
Description
J.T. Conklin
2007-11-30 23:09:45 CST
Sun has reorganized their documentation, and the link in Comment #1 no longer works. Rather than chase links, I've excerpted the relevant section: 6.7.6 Referencing Static Variables and Static Functions Within a template definition, the compiler does not support referencing an object or function that is declared static at global scope or in a namespace. If multiple instances are generated, the One-Definition Rule (C++ standard section 3.2) is violated, because each instance refers to a different object. The usual failure indication is missing symbols at link time. If you want a single object to be shared by all template instantiations, then make the object a nonstatic member of a named namespace. If you want a different object for each instantiation of a template class, then make the object a static member of the template class. If you want a different object for each instantiation of a template function, then make the object local to the function. |