blob: 19276a0eef24590891e911bb773c09f2a1e578f1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
// <map>
// Check that std::multimap fails to instantiate if the comparison predicate is
// not copy-constructible. This is LWG issue 2436
#include <map>
template <class T>
struct Comp {
bool operator () (const T& lhs, const T& rhs) const { return lhs < rhs; }
Comp () {}
private:
Comp (const Comp &); // declared but not defined
};
int main() {
std::multimap<int, int, Comp<int> > m;
}
|