This is the mail archive of the gcc-bugs@gcc.gnu.org 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]

libstdc++/1767: bug with std::deque<T>::const_iterator::operator->()



>Number:         1767
>Category:       libstdc++
>Synopsis:       bug with std::deque<T>::const_iterator::operator->()
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 25 02:56:02 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Marc Duflot
>Release:        unknown-1.0
>Organization:
>Environment:
Reading specs from /usr/lib/gcc-lib/i486-suse-linux/2.95.2/specs
gcc version 2.95.2 19991024 (release)
>Description:
Code :

#include <deque>
class A
{
public : void f() const {}
};
int main ()
{
	std::deque<A> my_deque (1);
	std::deque<A>::const_iterator iter = my_deque.begin();
	iter->f();
}

Error message :

/usr/include/g++/stl_deque.h: In method `const class A & _Deque_iterator<A,const A &,const A &,0>::operator ->() const':
test.C:10:   instantiated from here
/usr/include/g++/stl_deque.h:138: conversion from `A *const' to non-scalar type `A' requested
test.C: In function `int main()':
test.C:10: result of `operator->()' yields non-pointer result
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:

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