Skip to content

Instantly share code, notes, and snippets.

@Endilll
Created May 19, 2023 16:20
Show Gist options
  • Save Endilll/e5ade4661e8e037a65864371f48a7757 to your computer and use it in GitHub Desktop.
Save Endilll/e5ade4661e8e037a65864371f48a7757 to your computer and use it in GitHub Desktop.
DR test structure changes
// Before
// ======
// RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++23 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
namespace dr102 { // dr102: yes
template<typename T> T f(T a, T b) { return a + b; } // expected-error
} // namespace dr102
// dr103: na
// dr104: na lib
// dr105: na
namespace dr164 { // dr164: yes
template <class T> int g(T t) { return f(t); }
} // namespace dr164
namespace { // dr171: yes
int dr171a;
}
int dr171b;
namespace dr171 {
extern "C" void dr171b();
} // namespace dr171;
// dr174: sup 1012
// After
// =====
// RUN: rm -rf %t && mkdir %t
// RUN: split-file --allow-comments --add-file-extension=cpp %s %t
// RUN: %clang_cc1 -std=c++11 %{for-each-file %t} -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++11 %{for-each-file %t} -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++14 %{for-each-file %t} -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++17 %{for-each-file %t} -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++20 %{for-each-file %t} -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++23 %{for-each-file %t} -verify -fexceptions -fcxx-exceptions -pedantic-errors
//--- dr102: yes
namespace dr102 {
template<typename T> T f(T a, T b) { return a + b; } // expected-error
} // namespace dr102
// dr103: na
// dr104: na lib
// dr105: na
//--- dr164: yes
namespace dr164 {
template <class T> int g(T t) { return f(t); }
} // namespace dr164
//--- dr171: yes
namespace {
int dr171a;
}
int dr171b;
namespace dr171 {
extern "C" void dr171b();
} // namespace dr171;
// dr174: sup 1012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment