Clang Project

clang_source_code/test/SemaCXX/nothrow-as-noexcept-ctor.cpp
1// RUN: %clang_cc1 %s -fcxx-exceptions -fsyntax-only -Wexceptions -verify -std=c++14
2
3// expected-no-diagnostics
4struct Base {
5  __attribute__((nothrow)) Base() {}
6};
7
8struct Derived : Base {
9  Derived() noexcept = default;
10};
11
12struct Base2 {
13   Base2() noexcept {}
14};
15
16struct Derived2 : Base2 {
17  __attribute__((nothrow)) Derived2() = default;
18};
19
20struct Base3 {
21  __attribute__((nothrow)) Base3() {}
22};
23
24struct Derived3 : Base3 {
25  __attribute__((nothrow)) Derived3() = default;
26};
27