]> granicus.if.org Git - clang/commitdiff
Teach LangOptions::resetNonModularOptions to actually do what it says it does
authorDouglas Gregor <dgregor@apple.com>
Thu, 15 Sep 2011 14:56:27 +0000 (14:56 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 15 Sep 2011 14:56:27 +0000 (14:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139791 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/LangOptions.cpp
test/Modules/Inputs/Module.framework/Headers/Module.h
test/Modules/on-demand-build.m

index e9e516f10d7613b15a6ca847e332b198d4d91b54..5f479dbb771cfeec4f422d61d383eb1313513aea 100644 (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"
 }
 
index af403c83955308c198839e073d585c053f1a5afd..0753b78cdbcb367136ead8ff814515d7c33853b6 100644 (file)
@@ -6,5 +6,6 @@ const char *getModuleVersion(void);
 
 @interface Module
 +(const char *)version; // retrieve module version
++alloc;
 @end
 
index d0557ebbee6500ee056163cf6e980a8577040cd0..418e912f6370fa699a2e2a788a8a2902c592a952 100644 (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}}
 }