{
std::map<unsigned int, int> mapByIndex;
std::map<std::string, unsigned> mapByName;
-
+
mapByIndex.insert(std::pair<unsigned, int>(0, 1));
mapByIndex.insert(std::pair<unsigned, int>(6, 5));
-
+
std::map<unsigned, int>::iterator itr(mapByIndex.begin());
// NB: notice, it's not mapByIndex!!
- test &= itr != mapByName.end(); // { dg-error "no" }
- test &= itr == mapByName.end(); // { dg-error "no" }
+ bool __attribute__((unused)) test = itr != mapByName.end(); // { dg-error "no" }
+ test &= itr == mapByName.end(); // { dg-error "no" }
}
-
{
std::set<unsigned int> setByIndex;
std::set<std::string> setByName;
-
+
std::set<unsigned int>::iterator itr(setByIndex.begin());
-
+
// NB: it's not setByIndex!!
- test &= itr != setByName.end(); // { dg-error "no" }
- test &= itr == setByName.end(); // { dg-error "no" }
+ bool __attribute__((unused)) test = itr != setByName.end(); // { dg-error "no" }
+ test &= itr == setByName.end(); // { dg-error "no" }
}
-