summaryrefslogtreecommitdiff
path: root/include/Support/ilist
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-06-03 18:48:59 +0000
committerChris Lattner <sabre@nondot.org>2004-06-03 18:48:59 +0000
commit6bf7ca5f6f1c26bf8fb579ba456dae7c6e6f7e3a (patch)
tree59bf9377e7b7fbd6dcb88c855b30e413a85c8d03 /include/Support/ilist
parent78b648c5e35f28382691ec32ec39ca3e1ede94c0 (diff)
downloadllvm-6bf7ca5f6f1c26bf8fb579ba456dae7c6e6f7e3a.tar.gz
llvm-6bf7ca5f6f1c26bf8fb579ba456dae7c6e6f7e3a.tar.bz2
llvm-6bf7ca5f6f1c26bf8fb579ba456dae7c6e6f7e3a.tar.xz
Only use the non-standards-compliant std::distance on the compiler that is
buggy, not for all compilers that are not GCC 3 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13990 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/Support/ilist')
-rw-r--r--include/Support/ilist9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/Support/ilist b/include/Support/ilist
index bfa601f9c9..499c3e2b9d 100644
--- a/include/Support/ilist
+++ b/include/Support/ilist
@@ -438,13 +438,14 @@ public:
//
size_type size() const {
-#if __GNUC__ == 3
- size_type Result = std::distance(begin(), end());
-#else
+#if __GNUC__ == 2
+ // GCC 2.95 has a broken std::distance
size_type Result = 0;
std::distance(begin(), end(), Result);
-#endif
return Result;
+#else
+ return std::distance(begin(), end());
+#endif
}
iterator erase(iterator first, iterator last) {