-
Bug
-
Resolution: Unresolved
-
Medium
-
Code Generation Tools
-
CODEGEN-4276
-
-
The library does not declare std::multimap::clear as noexcept, which is required by C++14 section 23.4.5.1 paragraph 2
clearing multimap of pairs unexpectedly throws exception
In the following code:
#include <map>
#include <string>
#define NMAP std::multimap<int, char>
#define NPAIR std::pair<int, char>
int main(void)
{
const NPAIR p100(1, 'a'), p200(2, 'b'), p300(3, 'c');
NMAP cl00
;
if (!noexcept(cl00.clear()))
failure("Unexpected return type");
return (2);
}
An exception gets thrown in the clear() function when clearing a multimap if <int,char> pairs.