diff --git a/clang/lib/Basic/LangOptions.cpp b/clang/lib/Basic/LangOptions.cpp index e9e516f10d76..5f479dbb771c 100644 --- a/clang/lib/Basic/LangOptions.cpp +++ b/clang/lib/Basic/LangOptions.cpp @@ -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" } diff --git a/clang/test/Modules/Inputs/Module.framework/Headers/Module.h b/clang/test/Modules/Inputs/Module.framework/Headers/Module.h index af403c839553..0753b78cdbcb 100644 --- a/clang/test/Modules/Inputs/Module.framework/Headers/Module.h +++ b/clang/test/Modules/Inputs/Module.framework/Headers/Module.h @@ -6,5 +6,6 @@ const char *getModuleVersion(void); @interface Module +(const char *)version; // retrieve module version ++alloc; @end diff --git a/clang/test/Modules/on-demand-build.m b/clang/test/Modules/on-demand-build.m index d0557ebbee65..418e912f6370 100644 --- a/clang/test/Modules/on-demand-build.m +++ b/clang/test/Modules/on-demand-build.m @@ -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}} }