From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10149 invoked by alias); 2 Dec 2002 09:06:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 10127 invoked by uid 71); 2 Dec 2002 09:06:00 -0000 Resent-Date: 2 Dec 2002 09:06:00 -0000 Resent-Message-ID: <20021202090600.10126.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, johnb@stl.sarov.ru Received: (qmail 10058 invoked by uid 61); 2 Dec 2002 09:04:56 -0000 Message-Id: <20021202090456.10057.qmail@sources.redhat.com> Date: Mon, 02 Dec 2002 01:06:00 -0000 From: johnb@stl.sarov.ru Reply-To: johnb@stl.sarov.ru To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: libstdc++/8780: std::vector iterators not recognized as pointers by templates in certain cases X-SW-Source: 2002-12/txt/msg00049.txt.bz2 List-Id: >Number: 8780 >Category: libstdc++ >Synopsis: std::vector iterators not recognized as pointers by templates in certain cases >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Mon Dec 02 01:06:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: Eugeny Belov >Release: g++ (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7) >Organization: >Environment: Red Hat Linux 8.0. >Description: The attached testcase code uses STL to check whether the type given in the template specification of is_pointer_helper (in this case std::vector::iterator) is a pointer type. (See also ISO\IEC 14882, 24.1.(1,2)) So, trying to compile this testcase by g++ I get the error messages: tr18877.cpp: In function `int main()': tr18877.cpp:37: `sizeof' applied to incomplete type ` STATIC_ASSERTION_FAILURE' tr18877.cpp:37: declaration does not declare anything The first error occure due the vector iterator isn`t a pointer type, the second warning is legitimate. >How-To-Repeat: Try to compile the testcase with g++. >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="veciter.cpp" Content-Disposition: inline; filename="veciter.cpp" #include //#include template struct static_assert_test{}; template struct STATIC_ASSERTION_FAILURE; template <> struct STATIC_ASSERTION_FAILURE{}; #define BOOST_STATIC_ASSERT( B ) static_assert_test)> template struct is_pointer_helper { static const bool value = false; }; template struct is_pointer_helper { static const bool value = true; }; template struct is_pointer_helper { static const bool value = true; }; template struct is_pointer_helper { static const bool value = true; }; template struct is_pointer_helper { static const bool value = true; }; int main(void) { BOOST_STATIC_ASSERT(is_pointer_helper::iterator>::value); return(0); }