Teach LangOptions::resetNonModularOptions to actually do what it says it does

llvm-svn: 139791
This commit is contained in:
Douglas Gregor 2011-09-15 14:56:27 +00:00
parent aa78b235a5
commit 8455e76fa1
3 changed files with 12 additions and 3 deletions

View File

@ -23,5 +23,8 @@ LangOptions::LangOptions() {
void LangOptions::resetNonModularOptions() {
#define LANGOPT(Name, Bits, Default, Description)
#define BENIGN_LANGOPT(Name, Bits, Default, Description) Name = Default;
#define BENIGN_ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
Name = Default;
#include "clang/Basic/LangOptions.def"
}

View File

@ -6,5 +6,6 @@ const char *getModuleVersion(void);
@interface Module
+(const char *)version; // retrieve module version
+alloc;
@end

View File

@ -1,12 +1,17 @@
// RUN: rm -rf %t
// RUN: %clang_cc1 -fmodule-cache-path %t -F %S/Inputs -DFOO -verify %s
// RUN: %clang_cc1 -x objective-c++ -fmodule-cache-path %t -F %S/Inputs -DFOO -verify %s
// RUN: %clang_cc1 -fmodule-cache-path %t -F %S/Inputs -DFOO -verify %s
// RUN: %clang_cc1 -fno-objc-infer-related-result-type -Werror -fmodule-cache-path %t -F %S/Inputs -DFOO -verify %s
// RUN: %clang_cc1 -fno-objc-infer-related-result-type -Werror -x objective-c++ -fmodule-cache-path %t -F %S/Inputs -DFOO -verify %s
// RUN: %clang_cc1 -fno-objc-infer-related-result-type -Werror -fmodule-cache-path %t -F %S/Inputs -DFOO -verify %s
__import_module__ Module;
@interface OtherClass
@end
// in module: expected-note{{class method 'alloc' is assumed to return an instance of its receiver type ('Module *')}}
void test_getModuleVersion() {
const char *version = getModuleVersion();
const char *version2 = [Module version];
OtherClass *other = [Module alloc]; // expected-error{{init}}
}