1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 // template <class Facet> bool has_facet(const locale& loc) throw();
16 #include "test_macros.h"
19 : public std::locale::facet
21 static std::locale::id id
;
24 std::locale::id
my_facet::id
;
29 assert(std::has_facet
<std::ctype
<char> >(loc
));
30 assert(!std::has_facet
<my_facet
>(loc
));
31 std::locale
loc2(loc
, new my_facet
);
32 assert(std::has_facet
<my_facet
>(loc2
));