Templated labels in egcs 2.91.16
Lee Iverson
leei@ai.sri.com
Thu Apr 2 11:32:00 GMT 1998
With the following source, we get a nice little illustrative error:
the second use of the `retry' label in a *different* function causes
confusion in the template instantiation mechanism. In essence, the
fact that we're reusing the label name leads to an unresolved
`reference' to the first label after the second label is properly
resolved. Changing the name of the label in resize() to retry2 solves
the problem and generates correct code.
% /opt/gnu/gcc/egcs-6.3/bin/g++ -include /home/canada3/IUE/v2.0.1.sri/include/gcc-vers.h Set.instance.C -O2 -g -Wall -fno-implicit-templates -finline-functions -DNOREPOS -DTIME_WITH_SYS_TIME=1 -DTWO_ARG_GETTIME=1 -DWORDS_BIGENDIAN=1 -UIV_INSTALLED -DCOOL_INSTALLED -DNOREPOS -I/home/canada3/IUE/v2.0.1.sri/src/lib/TargetJr/IUPackages/COOL -c -o IRIX6/Set.instance.o
/home/canada3/IUE/v2.0.1.sri/src/lib/TargetJr/IUPackages/COOL/cool/Set.C: In method `bool CoolSet<void *>::resize<void *>(long unsigned int)':
/home/canada3/IUE/v2.0.1.sri/src/lib/TargetJr/IUPackages/COOL/cool/Set.C:349: label `retry' used but not defined
/home/canada3/IUE/v2.0.1.sri/src/lib/TargetJr/IUPackages/COOL/cool/Set.C:333: warning: label `retry' defined but not used
-------------------------------------------------------------------------------
Lee Iverson SRI International
leei@ai.sri.com 333 Ravenswood Ave., Menlo Park CA 94025
http://www.ai.sri.com/~leei/ (650) 859-3307
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Set.instance.i.gz
Type: application/x-gzip
Size: 12476 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/19980402/706d1436/attachment.bin>
More information about the Gcc
mailing list