[cfe-commits] r126820 - in /cfe/trunk: lib/Sema/SemaExceptionSpec.cpp test/CXX/basic/basic.stc/basic.stc.dynamic/p2.cpp test/CXX/except/except.spec/p14.cpp test/CXX/temp/temp.decls/temp.variadic/p4.cpp test/SemaCXX/MicrosoftExtensions.cpp test/SemaCXX/exception-spec-no-exceptions.cpp test/SemaCXX/exception-spec.cpp
John McCall
rjmccall at apple.com
Tue Mar 1 18:04:40 PST 2011
Author: rjmccall
Date: Tue Mar 1 20:04:40 2011
New Revision: 126820
URL: http://llvm.org/viewvc/llvm-project?rev=126820&view=rev
Log:
Semantic checking for exception specifications should be triggered by
whether C++ exceptions are enabled, not exceptions in general. PR9358.
Modified:
cfe/trunk/lib/Sema/SemaExceptionSpec.cpp
cfe/trunk/test/CXX/basic/basic.stc/basic.stc.dynamic/p2.cpp
cfe/trunk/test/CXX/except/except.spec/p14.cpp
cfe/trunk/test/CXX/temp/temp.decls/temp.variadic/p4.cpp
cfe/trunk/test/SemaCXX/MicrosoftExtensions.cpp
cfe/trunk/test/SemaCXX/exception-spec-no-exceptions.cpp
cfe/trunk/test/SemaCXX/exception-spec.cpp
Modified: cfe/trunk/lib/Sema/SemaExceptionSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExceptionSpec.cpp?rev=126820&r1=126819&r2=126820&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExceptionSpec.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExceptionSpec.cpp Tue Mar 1 20:04:40 2011
@@ -160,7 +160,7 @@
// If exceptions are disabled, suppress the warning about missing
// exception specifications for new and delete operators.
- if (!getLangOptions().Exceptions) {
+ if (!getLangOptions().CXXExceptions) {
switch (New->getDeclName().getCXXOverloadedOperator()) {
case OO_New:
case OO_Array_New:
@@ -249,7 +249,7 @@
bool *MissingExceptionSpecification,
bool *MissingEmptyExceptionSpecification) {
// Just completely ignore this under -fno-exceptions.
- if (!getLangOptions().Exceptions)
+ if (!getLangOptions().CXXExceptions)
return false;
if (MissingExceptionSpecification)
@@ -331,7 +331,7 @@
const FunctionProtoType *Subset, SourceLocation SubLoc) {
// Just auto-succeed under -fno-exceptions.
- if (!getLangOptions().Exceptions)
+ if (!getLangOptions().CXXExceptions)
return false;
// FIXME: As usual, we could be more specific in our error messages, but
Modified: cfe/trunk/test/CXX/basic/basic.stc/basic.stc.dynamic/p2.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/basic/basic.stc/basic.stc.dynamic/p2.cpp?rev=126820&r1=126819&r2=126820&view=diff
==============================================================================
--- cfe/trunk/test/CXX/basic/basic.stc/basic.stc.dynamic/p2.cpp (original)
+++ cfe/trunk/test/CXX/basic/basic.stc/basic.stc.dynamic/p2.cpp Tue Mar 1 20:04:40 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -fexceptions -verify %s
+// RUN: %clang_cc1 -fsyntax-only -fexceptions -fcxx-exceptions -verify %s
int *use_new(int N) {
if (N == 1)
return new int;
Modified: cfe/trunk/test/CXX/except/except.spec/p14.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/except/except.spec/p14.cpp?rev=126820&r1=126819&r2=126820&view=diff
==============================================================================
--- cfe/trunk/test/CXX/except/except.spec/p14.cpp (original)
+++ cfe/trunk/test/CXX/except/except.spec/p14.cpp Tue Mar 1 20:04:40 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fexceptions -verify %s
+// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -verify %s
struct A { };
struct B { };
struct C { };
Modified: cfe/trunk/test/CXX/temp/temp.decls/temp.variadic/p4.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.decls/temp.variadic/p4.cpp?rev=126820&r1=126819&r2=126820&view=diff
==============================================================================
--- cfe/trunk/test/CXX/temp/temp.decls/temp.variadic/p4.cpp (original)
+++ cfe/trunk/test/CXX/temp/temp.decls/temp.variadic/p4.cpp Tue Mar 1 20:04:40 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++0x -fsyntax-only -fexceptions -verify %s
+// RUN: %clang_cc1 -std=c++0x -fsyntax-only -fexceptions -fcxx-exceptions -verify %s
template<typename... Types> struct tuple;
template<int I> struct int_c;
Modified: cfe/trunk/test/SemaCXX/MicrosoftExtensions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/MicrosoftExtensions.cpp?rev=126820&r1=126819&r2=126820&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/MicrosoftExtensions.cpp (original)
+++ cfe/trunk/test/SemaCXX/MicrosoftExtensions.cpp Tue Mar 1 20:04:40 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -fsyntax-only -Wmicrosoft -verify -fms-extensions -fexceptions
+// RUN: %clang_cc1 %s -fsyntax-only -Wmicrosoft -verify -fms-extensions -fexceptions -fcxx-exceptions
// ::type_info is predeclared with forward class declartion
Modified: cfe/trunk/test/SemaCXX/exception-spec-no-exceptions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/exception-spec-no-exceptions.cpp?rev=126820&r1=126819&r2=126820&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/exception-spec-no-exceptions.cpp (original)
+++ cfe/trunk/test/SemaCXX/exception-spec-no-exceptions.cpp Tue Mar 1 20:04:40 2011
@@ -1,7 +1,8 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -fexceptions -fobjc-exceptions %s
-// Note: this is intentionally -fno-exceptions, not just accidentally
-// so because that's the current -cc1 default.
+// Note that we're specifically excluding -fcxx-exceptions in the command line above.
+
+// That this should work even with -fobjc-exceptions is PR9358
// PR7243: redeclarations
namespace test0 {
Modified: cfe/trunk/test/SemaCXX/exception-spec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/exception-spec.cpp?rev=126820&r1=126819&r2=126820&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/exception-spec.cpp (original)
+++ cfe/trunk/test/SemaCXX/exception-spec.cpp Tue Mar 1 20:04:40 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -fexceptions %s
+// RUN: %clang_cc1 -fsyntax-only -verify -fexceptions -fcxx-exceptions %s
// Straight from the standard:
// Plain function with spec
More information about the cfe-commits
mailing list