xref: /aosp_15_r20/external/cronet/base/containers/fixed_flat_map_nocompile.nc (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1// Copyright 2024 The Chromium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// This is a "No Compile Test" suite.
6// http://dev.chromium.org/developers/testing/no-compile-tests
7
8#include "base/containers/fixed_flat_map.h"
9
10// Constructing a fixed flat map with duplicate keys should not compile.
11auto kDuplicates = base::MakeFixedFlatMap<int, int>(  // expected-error-re {{call to consteval function 'base::MakeFixedFlatMap<{{.+}}>' is not a constant expression}}
12    {{1, 0}, {1, 0}, {2, 0}, {3, 0}});
13