diff options
-rw-r--r-- | clang/lib/Lex/PPMacroExpansion.cpp | 2 | ||||
-rw-r--r-- | clang/test/Lexer/has_feature_rtti.cpp | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp index 42b1d048c40..594365b45e1 100644 --- a/clang/lib/Lex/PPMacroExpansion.cpp +++ b/clang/lib/Lex/PPMacroExpansion.cpp @@ -1076,7 +1076,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) { .Case("blocks", LangOpts.Blocks) .Case("c_thread_safety_attributes", true) .Case("cxx_exceptions", LangOpts.CXXExceptions) - .Case("cxx_rtti", LangOpts.RTTI) + .Case("cxx_rtti", LangOpts.RTTI && LangOpts.RTTIData) .Case("enumerator_attributes", true) .Case("nullability", true) .Case("memory_sanitizer", LangOpts.Sanitize.has(SanitizerKind::Memory)) diff --git a/clang/test/Lexer/has_feature_rtti.cpp b/clang/test/Lexer/has_feature_rtti.cpp index 4bfeead3299..26eaa2ead62 100644 --- a/clang/test/Lexer/has_feature_rtti.cpp +++ b/clang/test/Lexer/has_feature_rtti.cpp @@ -1,5 +1,6 @@ // RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-RTTI %s // RUN: %clang_cc1 -E -fno-rtti %s -o - | FileCheck --check-prefix=CHECK-NO-RTTI %s +// RUN: %clang_cc1 -E -fno-rtti-data %s -o - | FileCheck --check-prefix=CHECK-NO-RTTI %s #if __has_feature(cxx_rtti) int foo(); |