This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/9626: g++ accepts vector<vector<int> > v(2, 4);
- From: Falk Hueffner <falk dot hueffner at student dot uni-tuebingen dot de>
- To: gcc-gnats at gcc dot gnu dot org
- Date: Sat, 08 Feb 2003 04:45:44 +0100
- Subject: 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
>Closed-Date:
>Last-Modified:
>Originator: Falk Hueffner
>Release: 3.4 20030203 (experimental)
>Organization:
>Environment:
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++
>Description:
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.
>How-To-Repeat:
#include <vector>
std::vector<std::vector<int> > v(2, 4);
g++ test.cc # works, but should fail
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: