This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/9626: g++ accepts vector<vector<int> > v(2, 4);

>Number:         9626
>Category:       c++
>Synopsis:       g++ accepts vector<vector<int> > v(2, 4);
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          accepts-illegal
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 08 03:56:00 UTC 2003
>Originator:     Falk Hueffner
>Release:        3.4 20030203 (experimental)
System: Linux juist 2.5.59 #4 Sat Jan 18 12:46:41 CET 2003 alpha unknown unknown GNU/Linux
Architecture: alpha

host: alphaev68-unknown-linux-gnu
build: alphaev68-unknown-linux-gnu
target: alphaev68-unknown-linux-gnu
configured with: ../configure --disable-nls --enable-languags=c++ --with-gcc-version-trigger=/src/gcc-2003.02.03/gcc/version.c --no-create --no-recursion : (reconfigured) ../configure --disable-nls --enable-languages=c++
The std::vector constructor should look like this:

explicit vector(size_type n, const T& value = T(),
                const Allocator& = Allocator());

Since it is explicit, it should not be used for constructing the inner
vectors with '4', but g++ does that.
#include <vector>
std::vector<std::vector<int> > v(2, 4);
g++ # works, but should fail


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]