diff options
author | Nico Weber <nicolasweber@gmx.de> | 2012-05-20 01:27:21 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2012-05-20 01:27:21 +0000 |
commit | 11d1a697dcf677c42394dfa9506ace4935f3b00d (patch) | |
tree | b009a8d243dabc71ec7c4a6b8f0f19c1b06b56ee /lib/Sema/SemaExprCXX.cpp | |
parent | a2ac407e285290508c86baa358a0c011ce6f8958 (diff) |
Error when using typeid() with -fno-rtti. PR 12888.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157139 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index 3400529c76..efc13a9284 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -379,6 +379,10 @@ Sema::ActOnCXXTypeid(SourceLocation OpLoc, SourceLocation LParenLoc, return ExprError(Diag(OpLoc, diag::err_need_header_before_typeid)); } + if (!getLangOpts().RTTI) { + return ExprError(Diag(OpLoc, diag::err_no_typeid_with_fno_rtti)); + } + QualType TypeInfoType = Context.getTypeDeclType(CXXTypeInfoDecl); if (isType) { |