aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2008-07-12 07:00:52 +0000
committerNick Lewycky <nicholas@mxc.ca>2008-07-12 07:00:52 +0000
commit3566527256805a2edf362d164195524604db5664 (patch)
tree77157ea53692aea7afcc91cab563943678b05352 /include
parent245de42db44d621101f5ba77cb6fd8902824ffc1 (diff)
downloadexternal_llvm-3566527256805a2edf362d164195524604db5664.zip
external_llvm-3566527256805a2edf362d164195524604db5664.tar.gz
external_llvm-3566527256805a2edf362d164195524604db5664.tar.bz2
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')
-rw-r--r--include/llvm/ADT/ilist.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/llvm/ADT/ilist.h b/include/llvm/ADT/ilist.h
index 8d9bab5..41253e0 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) {}