mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 08:26:37 +00:00

Following: https://llvm.org/svn/llvm-project/cfe/trunk@329804 For C++17 the wording of [over.built] p4 excluded bool: For every pair (T , vq), where T is an arithmetic type other than bool, there exist candidate operator functions of the form vq T & operator++(vq T &); T operator++(vq T &, int); Differential Revision: https://reviews.llvm.org/D45569 llvm-svn: 330254
10 lines
313 B
C++
10 lines
313 B
C++
// RUN: %clang_cc1 -fsyntax-only -fshow-overloads=best -verify -triple x86_64-linux-gnu -std=c++17 %s
|
|
|
|
struct BoolRef {
|
|
operator bool&();
|
|
};
|
|
|
|
void foo(BoolRef br) {
|
|
// C++ [over.built]p3: Increment for bool was removed in C++17.
|
|
bool b = br++; // expected-error{{cannot increment value of type 'BoolRef'}}
|
|
} |