aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Parser/explicit-bool-pre-cxx17.cpp
blob: fee0889737a89cfe6247338afdf73fd3da6cef5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Regression test for assertion failure when explicit(bool) is used in pre-C++20
// Fixes GitHub issue #152729
// RUN: %clang_cc1 -std=c++98 -verify %s
// RUN: %clang_cc1 -std=c++03 -verify %s
// RUN: %clang_cc1 -std=c++11 -verify %s
// RUN: %clang_cc1 -std=c++14 -verify %s
// RUN: %clang_cc1 -std=c++17 -verify %s

struct S {
  explicit(true) S(int);
  // expected-warning@-1 {{explicit(bool) is a C++20 extension}}
  
  explicit(false) S(float);
  // expected-warning@-1 {{explicit(bool) is a C++20 extension}}
};