<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: CXX: Reference to instantiated template bug in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/cxx-reference-to-instantiated-template-bug/m-p/4575643#M39476</link>
    <description>&lt;!--!*#--&gt;I know nothing about C++, but you might try&lt;BR /&gt;either not using both "a.h" and "a.cpp" as&lt;BR /&gt;file names, or using /NOIMPLICIT_INCLUDE.&lt;BR /&gt;&lt;BR /&gt;HELP CXX /IMPLICIT_INCLUDE</description>
    <pubDate>Mon, 01 Feb 2010 19:12:03 GMT</pubDate>
    <dc:creator>Steven Schweda</dc:creator>
    <dc:date>2010-02-01T19:12:03Z</dc:date>
    <item>
      <title>CXX: Reference to instantiated template bug</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cxx-reference-to-instantiated-template-bug/m-p/4575642#M39475</link>
      <description>&lt;!--!*#--&gt;Here's a quick repro on a bug in CXX:&lt;BR /&gt;&lt;BR /&gt;COLOMA-ALAN&amp;gt;cxx/ver&lt;BR /&gt;HP C++ V7.3-009 for OpenVMS Alpha V8.3&lt;BR /&gt;&lt;BR /&gt;COLOMA-ALAN&amp;gt;type a.h&lt;BR /&gt;#ifndef A_H&lt;BR /&gt;#define A_H&lt;BR /&gt;&lt;BR /&gt;template&lt;CLASS t=""&gt;&lt;BR /&gt;class Templ&lt;BR /&gt;{&lt;BR /&gt;        public:&lt;BR /&gt;        T* Func();&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;COLOMA-ALAN&amp;gt;type a.cpp&lt;BR /&gt;#include "a.h"&lt;BR /&gt;&lt;BR /&gt;void someFunc()&lt;BR /&gt;{&lt;BR /&gt;        int* ptr = Templ&lt;INT&gt;().Func();&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;COLOMA-ALAN&amp;gt;cxx a.cpp&lt;BR /&gt;&lt;BR /&gt;void someFunc()&lt;BR /&gt;.....^&lt;BR /&gt;%CXX-E-REDEF, declaration has already been defined by function&lt;BR /&gt;          "someFunc" (declared at line 3 of&lt;BR /&gt;          "$1$DGA1269:[AEGANTONUK.temp]a.cpp;1")&lt;BR /&gt;at line number 3 in file $1$DGA1269:[AEGANTONUK.temp]a.cpp;1&lt;BR /&gt;&lt;BR /&gt;%CXX-I-MESSAGE, 1 error detected in the compilation of "$1$DGA1269:[AEGANTONUK.temp]a.cpp;1".&lt;BR /&gt;&lt;BR /&gt;====================&lt;BR /&gt;Interesting aspects of this bug:&lt;BR /&gt;COLOMA-ALAN&amp;gt;RENAME a.cpp b.cpp&lt;BR /&gt;COLOMA-ALAN&amp;gt;cxx b.cpp&lt;BR /&gt;---- No errors&lt;BR /&gt;Another interesting aspect of this bug:&lt;BR /&gt;COLOMA-ALAN&amp;gt;COPY a.cpp b.cpp&lt;BR /&gt;COLOMA-ALAN&amp;gt;cxx b.cpp&lt;BR /&gt;&lt;BR /&gt;void someFunc()&lt;BR /&gt;.....^&lt;BR /&gt;%CXX-E-REDEF, declaration has already been defined by function&lt;BR /&gt;          "someFunc" (declared at line 3 of&lt;BR /&gt;          "$1$DGA1269:[AEGANTONUK.temp]b.cpp;1")&lt;BR /&gt;at line number 3 in file $1$DGA1269:[AEGANTONUK.temp]a.cpp;1&lt;BR /&gt;&lt;BR /&gt;%CXX-I-MESSAGE, 1 error detected in the compilation of "$1$DGA1269:[AEGANTONUK.temp]b.cpp;1".&lt;BR /&gt;&lt;BR /&gt;***** Why is the compiler trying to compile a.cpp?!?!?&lt;BR /&gt;&lt;/INT&gt;&lt;/CLASS&gt;</description>
      <pubDate>Mon, 01 Feb 2010 18:39:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cxx-reference-to-instantiated-template-bug/m-p/4575642#M39475</guid>
      <dc:creator>AlanAntonuk</dc:creator>
      <dc:date>2010-02-01T18:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: CXX: Reference to instantiated template bug</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cxx-reference-to-instantiated-template-bug/m-p/4575643#M39476</link>
      <description>&lt;!--!*#--&gt;I know nothing about C++, but you might try&lt;BR /&gt;either not using both "a.h" and "a.cpp" as&lt;BR /&gt;file names, or using /NOIMPLICIT_INCLUDE.&lt;BR /&gt;&lt;BR /&gt;HELP CXX /IMPLICIT_INCLUDE</description>
      <pubDate>Mon, 01 Feb 2010 19:12:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cxx-reference-to-instantiated-template-bug/m-p/4575643#M39476</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-02-01T19:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: CXX: Reference to instantiated template bug</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cxx-reference-to-instantiated-template-bug/m-p/4575644#M39477</link>
      <description>/IMPLICIT_INCLUDE seems to be the issue.&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;That said: having this as a default without any kind diagnostic as to whats going on, while it may make for some backwards compatibility with something; is rather confusing for those who don't know about this compiler switch.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 01 Feb 2010 20:24:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cxx-reference-to-instantiated-template-bug/m-p/4575644#M39477</guid>
      <dc:creator>AlanAntonuk</dc:creator>
      <dc:date>2010-02-01T20:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: CXX: Reference to instantiated template bug</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cxx-reference-to-instantiated-template-bug/m-p/4575645#M39478</link>
      <description>&lt;!--!*#--&gt;&amp;gt; [...] having this as a default [...]&lt;BR /&gt;&lt;BR /&gt;Knowing nothing, I assume that any serious&lt;BR /&gt;C++ user would prefer it this way.  A visit&lt;BR /&gt;to the C++ language reference manual and/or&lt;BR /&gt;user guide might be informative.&lt;BR /&gt;&lt;BR /&gt;Learning more (that is, anything useful)&lt;BR /&gt;about C++ has been on my to-do list for a&lt;BR /&gt;long time.  Sadly, laziness is among my many&lt;BR /&gt;character flaws.</description>
      <pubDate>Mon, 01 Feb 2010 20:30:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cxx-reference-to-instantiated-template-bug/m-p/4575645#M39478</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-02-01T20:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: CXX: Reference to instantiated template bug</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cxx-reference-to-instantiated-template-bug/m-p/4575646#M39479</link>
      <description>I am proficient at C++, but by no means someone who has explored some of the dark musty corners of the language.&lt;BR /&gt;&lt;BR /&gt;That said HP CXX is the only modern compiler that I've come across that has done this by default (I've used gcc, icc, and visual-c++).&lt;BR /&gt;&lt;BR /&gt;These all require you to explicitly #include anything that the compiler sees.&lt;BR /&gt;&lt;BR /&gt;Anyhow mystery solved.</description>
      <pubDate>Mon, 01 Feb 2010 21:06:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cxx-reference-to-instantiated-template-bug/m-p/4575646#M39479</guid>
      <dc:creator>AlanAntonuk</dc:creator>
      <dc:date>2010-02-01T21:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: CXX: Reference to instantiated template bug</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cxx-reference-to-instantiated-template-bug/m-p/4575647#M39480</link>
      <description>&lt;!--!*#--&gt;FYI,&lt;BR /&gt;on v6.3-020 version of cxx, compiling a.cpp as above gives no errors, but when a.cpp is copied to b.cpp, your error appears:&lt;BR /&gt;void someFunc()&lt;BR /&gt;.....^&lt;BR /&gt;%CXX-E-REDEF, declaration has already been defined by function&lt;BR /&gt;          "someFunc" (declared at line 3 of&lt;BR /&gt;&lt;BR /&gt;/list produces:&lt;BR /&gt;_VMS_VER=70320022 __VMS_VERSION="V7.3-2  " __vms_version="V7.3-2  " __G_FLOAT&lt;BR /&gt; __D_FLOAT=0 __vms __VMS __INITIAL_POINTER_SIZE=0 __BIASED_FLT_ROUNDS=2&lt;BR /&gt; __32BITS __IEEE_FLOAT=0 __Alpha_AXP _LONGLONG __alpha__ __alpha __ALPHA&lt;BR /&gt; __DECCXX_VER=60390020 __MODEL_ARM __STD_ANSI __IMPLICIT_INCLUDE_ENABLED&lt;BR /&gt; __STDNEW __X_FLOAT __PRAGMA_ENVIRONMENT __DECCXX __EDG_VERSION__=243 __EDG__&lt;BR /&gt; __IMPLICIT_USING_STD __RTTI __EXCEPTIONS __GLOBAL_ARRAY_NEW&lt;BR /&gt; __BOOL_IS_A_RESERVED_WORD _BOOL_EXISTS __WCHAR_T _WCHAR_T __cplusplus&lt;BR /&gt; __TIME__="13:25:45" __DATE__="Feb  5 2010"&lt;BR /&gt;&lt;BR /&gt;Amusing!</description>
      <pubDate>Fri, 05 Feb 2010 02:32:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cxx-reference-to-instantiated-template-bug/m-p/4575647#M39480</guid>
      <dc:creator>MarkOfAus</dc:creator>
      <dc:date>2010-02-05T02:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: CXX: Reference to instantiated template bug</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cxx-reference-to-instantiated-template-bug/m-p/4575648#M39481</link>
      <description>&amp;gt;by no means someone who has explored some of the dark musty corners of the language.&lt;BR /&gt;&lt;BR /&gt;Yes, this is from the very musty past.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;These all require you to explicitly #include anything that the compiler sees.&lt;BR /&gt;&lt;BR /&gt;Right.  On HP-UX we had the transition from cfront to aC++ but required an option.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Steven: using /NOIMPLICIT_INCLUDE.&lt;BR /&gt;&lt;BR /&gt;Yes I immediately thought of cfront.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I assume that any serious C++ user would prefer it this way.&lt;BR /&gt;&lt;BR /&gt;No, any serious C++ programmer knows the C++ Standard says that this cfront coding template coding style is obsolete and probably illegal.&lt;BR /&gt;If you want the template bodies, you explicitly include them.</description>
      <pubDate>Sat, 06 Feb 2010 02:57:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cxx-reference-to-instantiated-template-bug/m-p/4575648#M39481</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-02-06T02:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: CXX: Reference to instantiated template bug</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/cxx-reference-to-instantiated-template-bug/m-p/4575649#M39482</link>
      <description>&lt;!--!*#--&gt;&amp;gt; That said HP CXX is the only modern compiler that I've come across that has done this by default (I've used gcc, icc, and visual-c++).&lt;BR /&gt;&lt;BR /&gt;From what I can see in some configuration file, IBM AIX VisualAge C++ starting with version 5.0.2.0 also does implicit inclusion by default, but I cannot verify it.&lt;BR /&gt;&lt;BR /&gt;I'm not sure about the Alpha compiler, but IPF compiler does not do implicit inclusion in gnu compatibility mode, so, if you are porting stuff from gcc, it may be a good idea to compile it with /stand=gnu.&lt;BR /&gt;&lt;BR /&gt;-Boris&lt;BR /&gt;&lt;BR /&gt;a.h&lt;BR /&gt;---&lt;BR /&gt;#ifndef A_H&lt;BR /&gt;#define A_H&lt;BR /&gt;&lt;BR /&gt;template&lt;CLASS t=""&gt;&lt;BR /&gt;class Templ&lt;BR /&gt;{&lt;BR /&gt;  public:&lt;BR /&gt;  T* Func();&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;a.cc&lt;BR /&gt;----&lt;BR /&gt;#include "a.h"&lt;BR /&gt;&lt;BR /&gt;template&lt;CLASS t=""&gt; T* Templ&lt;T&gt;::Func() { return 0; }&lt;BR /&gt;&lt;BR /&gt;a.cpp&lt;BR /&gt;-----&lt;BR /&gt;#include "a.h"&lt;BR /&gt;&lt;BR /&gt;int main() {&lt;BR /&gt;  return *Templ&lt;INT&gt;().Func();&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;$ cxx a.cpp&lt;BR /&gt;$ cxxlink a.obj&lt;BR /&gt;$ cxx a.cpp/stand=gnu&lt;BR /&gt;$ cxxlink a.obj&lt;BR /&gt;%ILINK-W-NUDFSYMS, 1 undefined symbol:&lt;BR /&gt;%ILINK-I-UDFSYM,        int *Templ&lt;INT&gt; ::Func()&lt;BR /&gt;%ILINK-W-USEUNDEF, undefined symbol int *Templ&lt;INT&gt; ::Func() referenced&lt;BR /&gt;        source code name: "Templ&lt;INT&gt;::Func()"&lt;BR /&gt;&lt;/INT&gt;&lt;/INT&gt;&lt;/INT&gt;&lt;/INT&gt;&lt;/T&gt;&lt;/CLASS&gt;&lt;/CLASS&gt;</description>
      <pubDate>Tue, 09 Feb 2010 23:38:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/cxx-reference-to-instantiated-template-bug/m-p/4575649#M39482</guid>
      <dc:creator>WW304289</dc:creator>
      <dc:date>2010-02-09T23:38:36Z</dc:date>
    </item>
  </channel>
</rss>

