diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2008-07-12 07:00:52 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2008-07-12 07:00:52 +0000 |
commit | 066075030ad46b3494480a5f79f05443f947aca7 (patch) | |
tree | 77157ea53692aea7afcc91cab563943678b05352 /include/llvm/ADT/ilist.h | |
parent | 3ac9e109b24eaae482eb914d970ba7980f462925 (diff) | |
download | llvm-066075030ad46b3494480a5f79f05443f947aca7.tar.gz llvm-066075030ad46b3494480a5f79f05443f947aca7.tar.bz2 llvm-066075030ad46b3494480a5f79f05443f947aca7.tar.xz |
operator[] is not defined for list::iterator. Overload it in ilist::iterator
to prevent silly things from happening accidentally. PR2171
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53507 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/ilist.h')
-rw-r--r-- | include/llvm/ADT/ilist.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/llvm/ADT/ilist.h b/include/llvm/ADT/ilist.h index 8d9bab5caa..41253e030c 100644 --- a/include/llvm/ADT/ilist.h +++ b/include/llvm/ADT/ilist.h @@ -93,6 +93,10 @@ public: typedef typename super::reference reference; private: pointer NodePtr; + + // operator[] is not defined. Compile error instead of having a runtime bug. + void operator[](unsigned) {} + void operator[](unsigned) const {} public: ilist_iterator(pointer NP) : NodePtr(NP) {} |