brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 3341e29 Raw
54 lines · cpp
1// RUN: %clang_cc1 -pedantic-errors -std=c++11 -emit-pch %s -o %t.12// RUN: %clang_cc1 -pedantic-errors -std=c++11 -include-pch %t.1 -emit-pch %s -o %t.23// RUN: %clang_cc1 -pedantic-errors -std=c++11 -include-pch %t.2 -verify %s4// RUN: %clang_cc1 -pedantic-errors -std=c++11 -include-pch %t.2 -emit-llvm-only %s5 6// RUN: %clang_cc1 -pedantic-errors -std=c++11 -emit-pch -fpch-instantiate-templates %s -o %t.17// RUN: %clang_cc1 -pedantic-errors -std=c++11 -include-pch %t.1 -emit-pch -fpch-instantiate-templates %s -o %t.28// RUN: %clang_cc1 -pedantic-errors -std=c++11 -include-pch %t.2 -verify %s9// RUN: %clang_cc1 -pedantic-errors -std=c++11 -include-pch %t.2 -emit-llvm-only %s10 11// expected-no-diagnostics12 13#ifndef PHASE1_DONE14#define PHASE1_DONE15 16template<int n> int f() noexcept(n % 2) { return 0; }17template<int n> int g() noexcept(n % 2);18 19decltype(f<2>()) f0;20decltype(f<3>()) f1;21template int f<4>();22template int f<5>();23decltype(f<6>()) f6;24decltype(f<7>()) f7;25 26struct A {27  A();28  A(const A&);29};30 31decltype(g<0>()) g0;32 33#elif !defined(PHASE2_DONE)34#define PHASE2_DONE35 36template int f<6>();37template int f<7>();38decltype(f<8>()) f8;39decltype(f<9>()) f9;40template int f<10>();41template int f<11>();42 43A::A() = default;44A::A(const A&) = default;45 46int g0val = g<0>();47 48#else49 50static_assert(!noexcept(f<0>()), "");51static_assert(noexcept(f<1>()), "");52 53#endif54