[cfe-commits] r139791 - in /cfe/trunk: lib/Basic/LangOptions.cpp test/Modules/Inputs/Module.framework/Headers/Module.h test/Modules/on-demand-build.m
Douglas Gregor
dgregor at apple.com
Thu Sep 15 07:56:28 PDT 2011
Author: dgregor
Date: Thu Sep 15 09:56:27 2011
New Revision: 139791
URL: http://llvm.org/viewvc/llvm-project?rev=139791&view=rev
Log:
Teach LangOptions::resetNonModularOptions to actually do what it says it does
Modified:
cfe/trunk/lib/Basic/LangOptions.cpp
cfe/trunk/test/Modules/Inputs/Module.framework/Headers/Module.h
cfe/trunk/test/Modules/on-demand-build.m
Modified: cfe/trunk/lib/Basic/LangOptions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/LangOptions.cpp?rev=139791&r1=139790&r2=139791&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/LangOptions.cpp (original)
+++ cfe/trunk/lib/Basic/LangOptions.cpp Thu Sep 15 09:56:27 2011
@@ -23,5 +23,8 @@
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"
}
Modified: cfe/trunk/test/Modules/Inputs/Module.framework/Headers/Module.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/Module.framework/Headers/Module.h?rev=139791&r1=139790&r2=139791&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/Module.framework/Headers/Module.h (original)
+++ cfe/trunk/test/Modules/Inputs/Module.framework/Headers/Module.h Thu Sep 15 09:56:27 2011
@@ -6,5 +6,6 @@
@interface Module
+(const char *)version; // retrieve module version
++alloc;
@end
Modified: cfe/trunk/test/Modules/on-demand-build.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/on-demand-build.m?rev=139791&r1=139790&r2=139791&view=diff
==============================================================================
--- cfe/trunk/test/Modules/on-demand-build.m (original)
+++ cfe/trunk/test/Modules/on-demand-build.m Thu Sep 15 09:56:27 2011
@@ -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;
+ at interface OtherClass
+ at 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}}
}
More information about the cfe-commits
mailing list