mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-29 12:46:06 +00:00

-fms-extensions is intended to enable conforming language extensions and -fms-compatibility is intended to language rule relaxations, so a user could plausibly compile with -fno-ms-compatibility on Windows while still using dllexport, for example. This exception specification validation behavior has been handled as a warning since before -fms-compatibility was added in 2011. I think it's just an oversight that it hasn't been moved yet. This will help users find conformance issues in their code such as those found in _com_ptr_t as described in https://llvm.org/PR42842. Reviewers: hans Subscribers: STL_MSFT, cfe-commits Differential Revision: https://reviews.llvm.org/D66770 llvm-svn: 370087
15 lines
417 B
C++
15 lines
417 B
C++
// RUN: %clang_cc1 %s -triple %itanium_abi_triple -fcxx-exceptions -fms-compatibility -emit-llvm -o - | FileCheck %s
|
|
|
|
extern "C" {
|
|
void f();
|
|
|
|
// In MS mode we don't validate the exception specification.
|
|
void f() throw() {
|
|
}
|
|
}
|
|
|
|
// PR18661: Clang would fail to emit function definition with mismatching
|
|
// exception specification, even though it was just treated as a warning.
|
|
|
|
// CHECK: define {{.*}}void @f()
|