forked from OSchip/llvm-project
Teach LangOptions::resetNonModularOptions to actually do what it says it does
llvm-svn: 139791
This commit is contained in:
parent
aa78b235a5
commit
8455e76fa1
|
@ -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"
|
||||
}
|
||||
|
||||
|
|
|
@ -6,5 +6,6 @@ const char *getModuleVersion(void);
|
|||
|
||||
@interface Module
|
||||
+(const char *)version; // retrieve module version
|
||||
+alloc;
|
||||
@end
|
||||
|
||||
|
|
|
@ -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}}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue