1 // RUN: %clang_cc1 -std=c++11 -fms-extensions -emit-llvm %s -o - -triple=x86_64-pc-win32 -Wno-noexcept-type -fms-compatibility-version=19.12 | FileCheck %s --check-prefix=CHECK --check-prefix=CXX11
2 // RUN: %clang_cc1 -std=c++17 -fms-extensions -emit-llvm %s -o - -triple=x86_64-pc-win32 | FileCheck %s --check-prefix=CHECK --check-prefix=NOCOMPAT
3 // RUN: %clang_cc1 -std=c++17 -fms-extensions -emit-llvm %s -o - -triple=x86_64-pc-win32 -fms-compatibility-version=19.12 | FileCheck %s --check-prefix=CHECK --check-prefix=CXX17
4
5 // Prove that mangling only changed for noexcept types under /std:C++17, not all noexcept functions
6 // CHECK-DAG: @"?nochange@@YAXXZ"
nochange()7 void nochange() noexcept {}
8
9 // CXX11-DAG: @"?a@@YAXP6AHXZ@Z"
10 // NOCOMPAT-DAG: @"?a@@YAXP6AHXZ@Z"
11 // CXX17-DAG: @"?a@@YAXP6AHX_E@Z"
a(int ()noexcept)12 void a(int() noexcept) {}
13 // CHECK-DAG: @"?b@@YAXP6AHXZ@Z"
b(int ()noexcept (false))14 void b(int() noexcept(false)) {}
15 // CXX11-DAG: @"?c@@YAXP6AHXZ@Z"
16 // NOCOMPAT-DAG: @"?c@@YAXP6AHXZ@Z"
17 // CXX17-DAG: @"?c@@YAXP6AHX_E@Z"
c(int ()noexcept (true))18 void c(int() noexcept(true)) {}
19 // CHECK-DAG: @"?d@@YAXP6AHXZ@Z"
d(int ())20 void d(int()) {}
21
22 template <typename T>
23 class e;
24 template <typename T, typename... U>
25 class e<T(U...) noexcept> {
26 // CXX11-DAG: @"?ee@?$e@$$A6AXXZ@@EEAAXXZ"
27 // NOCOMPAT-DAG: @"?ee@?$e@$$A6AXXZ@@EEAAXXZ"
28 // CXX17-DAG: @"?ee@?$e@$$A6AXX_E@@EEAAXXZ"
ee(U &&...)29 virtual T ee(U &&...) noexcept {};
30 };
31
32 e<void() noexcept> e1;
33
34 template <typename T>
35 class f;
36 template <typename T, typename... U>
37 class f<T(U...)> {
38 // CHECK-DAG: @"?ff@?$f@$$A6AXXZ@@EEAAXXZ"
ff(U &&...)39 virtual T ff(U &&...) noexcept {};
40 };
41
42 f<void()> f1;
43