[Bug c++/14397] New: Trules no longer compile (regression)

schmid at snake dot iap dot physik dot tu-darmstadt dot de gcc-bugzilla@gcc.gnu.org
Wed Mar 3 05:24:00 GMT 2004


The following code, t.C, taken from the file pointers/truletest.cpp from the 
book C++ Templates - The Complete Guide by David Vandevoorde and Nicolai M. 
Josuttis, does no longer compile. It worked when last tried approximately a 
week ago. gcc 3.3 accepts this code without a problem. 
 
I appologize if this is a bogus bug report. 
 
source code 
t.C  
/* The following code example is taken from the book 
 * "C++ Templates - The Complete Guide" 
 * by David Vandevoorde and Nicolai M. Josuttis, Addison-Wesley, 2002 
 * 
 * (C) Copyright David Vandevoorde and Nicolai M. Josuttis 2002. 
 * Permission to copy, use, modify, sell and distribute this software 
 * is granted provided this copyright notice appears in all copies. 
 * This software is provided "as is" without express or implied 
 * warranty, and with no claim as to its suitability for any purpose. 
 */ 
#include "holder2.hpp" 
#include "trule.hpp" 
 
class Something { 
}; 
 
void read_something (Something* ) 
{ 
} 
 
Trule<Something> load_something()  
{ 
    Holder<Something> result(new Something); 
    read_something(result.get()); 
    return result; 
} 
 
int main()  
{ 
    Holder<Something> ptr(load_something()); 
    //... 
} 
 
Compiling t.C 
 
g++ -v -W -Wall t.C -save-temps 
Reading specs from /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/specs 
Configured with: ../gcc/configure --enable-threads=posix --enable-languages=c,c
++,f77,objc --enable-__cxa_atexit --enable-libstdcxx-debug 
Thread model: posix 
gcc version 3.4.0 20040302 (prerelease) 
 /usr/local/libexec/gcc/i686-pc-linux-gnu/3.4.0/cc1plus -E -quiet -v 
-D_GNU_SOURCE t.C -mtune=pentiumpro -W -Wall -o t.ii 
ignoring nonexistent directory "NONE/include" 
ignoring nonexistent directory "/usr/local/lib/gcc/
i686-pc-linux-gnu/3.4.0/../../../../i686-pc-linux-gnu/include" 
#include "..." search starts here: 
#include <...> search starts here: 
 /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0 
 /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0/
i686-pc-linux-gnu 
 /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../include/c++/3.4.0/
backward 
 /usr/local/include 
 /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.0/include 
 /usr/include 
End of search list. 
 /usr/local/libexec/gcc/i686-pc-linux-gnu/3.4.0/cc1plus -fpreprocessed t.ii 
-quiet -dumpbase t.C -mtune=pentiumpro -auxbase t -W -Wall -version -o t.s 
GNU C++ version 3.4.0 20040302 (prerelease) (i686-pc-linux-gnu) 
	compiled by GNU C version 3.4.0 20040302 (prerelease). 
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64274 
trule.hpp: In function `Trule<Something> load_something()': 
trule.hpp:42: error: `Trule<T>::Trule(Trule<T>&) [with T = Something]' is 
private 
t.C:25: error: within this context 
t.C:25: error:   initializing temporary from result of 
`Trule<T>::Trule(Holder<T>&) [with T = Something]' 
trule.hpp: In function `int main()': 
trule.hpp:42: error: `Trule<T>::Trule(Trule<T>&) [with T = Something]' is 
private 
t.C:30: error: within this context 
 
Compilation exited abnormally with code 1 at Tue Mar  2 21:45:22

-- 
           Summary: Trules no longer compile (regression)
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P1
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: schmid at snake dot iap dot physik dot tu-darmstadt dot
                    de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14397



More information about the Gcc-bugs mailing list