brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1017 B · cc30112 Raw
27 lines · cpp
1//===----------------------------------------------------------------------===//2//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-exception6//7//===----------------------------------------------------------------------===//8 9#include <cmath>10 11void f() {12    unsigned int ui = -5;13    (void)std::abs(ui); // expected-error {{call to 'abs' is ambiguous}}14 15    unsigned char uc = -5;16    (void)std::abs(uc); // expected-warning 0-1 {{taking the absolute value of unsigned type 'unsigned char' has no effect}}17 18    unsigned short us = -5;19    (void)std::abs(us); // expected-warning 0-1 {{taking the absolute value of unsigned type 'unsigned short' has no effect}}20 21    unsigned long ul = -5;22    (void)std::abs(ul); // expected-error {{call to 'abs' is ambiguous}}23 24    unsigned long long ull = -5;25    (void)std::abs(ull); // expected-error {{call to 'abs' is ambiguous}}26}27