Author: Vlad Serebrennikov Date: 2026-03-19T05:53:02+04:00 New Revision: 3fdec1c9f9469587de24a525b48aa6ceddc392f5
URL: https://github.com/llvm/llvm-project/commit/3fdec1c9f9469587de24a525b48aa6ceddc392f5 DIFF: https://github.com/llvm/llvm-project/commit/3fdec1c9f9469587de24a525b48aa6ceddc392f5.diff LOG: [clang] Enable exceptions in CWG2486 test (#187195) In #107131 I totally missed the fact that the entire `cwg24xx.cpp` was running without exceptions. This patch rectifies that, and uncovers one diagnostic in pre-C++17 modes that CWG2486 test was missing. Added: Modified: clang/test/CXX/drs/cwg24xx.cpp Removed: ################################################################################ diff --git a/clang/test/CXX/drs/cwg24xx.cpp b/clang/test/CXX/drs/cwg24xx.cpp index 8d0c2c064199f..b27c6b823940c 100644 --- a/clang/test/CXX/drs/cwg24xx.cpp +++ b/clang/test/CXX/drs/cwg24xx.cpp @@ -1,10 +1,10 @@ -// RUN: %clang_cc1 -std=c++98 -pedantic-errors %s -verify-directives -verify=expected,cxx98-14 -// RUN: %clang_cc1 -std=c++11 -pedantic-errors %s -verify-directives -verify=expected,cxx98-14 -// RUN: %clang_cc1 -std=c++14 -pedantic-errors %s -verify-directives -verify=expected,cxx98-14 -// RUN: %clang_cc1 -std=c++17 -pedantic-errors %s -verify-directives -verify=expected,since-cxx17 -// RUN: %clang_cc1 -std=c++20 -pedantic-errors %s -verify-directives -verify=expected,since-cxx20,since-cxx17 -// RUN: %clang_cc1 -std=c++23 -pedantic-errors %s -verify-directives -verify=expected,since-cxx20,since-cxx17 -// RUN: %clang_cc1 -std=c++2c -pedantic-errors %s -verify-directives -verify=expected,since-cxx20,since-cxx17 +// RUN: %clang_cc1 -std=c++98 -fexceptions -fcxx-exceptions -pedantic-errors %s -verify-directives -verify=expected,cxx98-14 +// RUN: %clang_cc1 -std=c++11 -fexceptions -fcxx-exceptions -pedantic-errors %s -verify-directives -verify=expected,cxx98-14 +// RUN: %clang_cc1 -std=c++14 -fexceptions -fcxx-exceptions -pedantic-errors %s -verify-directives -verify=expected,cxx98-14 +// RUN: %clang_cc1 -std=c++17 -fexceptions -fcxx-exceptions -pedantic-errors %s -verify-directives -verify=expected,since-cxx17 +// RUN: %clang_cc1 -std=c++20 -fexceptions -fcxx-exceptions -pedantic-errors %s -verify-directives -verify=expected,since-cxx20,since-cxx17 +// RUN: %clang_cc1 -std=c++23 -fexceptions -fcxx-exceptions -pedantic-errors %s -verify-directives -verify=expected,since-cxx20,since-cxx17 +// RUN: %clang_cc1 -std=c++2c -fexceptions -fcxx-exceptions -pedantic-errors %s -verify-directives -verify=expected,since-cxx20,since-cxx17 // cwg2406 is in cwg2406.cpp @@ -172,7 +172,8 @@ void ref() { void (*p)(); void (*pp)() throw() = p; -// since-cxx17-error@-1 {{cannot initialize a variable of type 'void (*)() throw()' with an lvalue of type 'void (*)()': diff erent exception specifications}} +// cxx98-14-error@-1 {{target exception specification is not superset of source}} +// since-cxx17-error@-2 {{cannot initialize a variable of type 'void (*)() throw()' with an lvalue of type 'void (*)()': diff erent exception specifications}} struct S { typedef void (*p)(); _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
