aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2012-05-20 01:27:21 +0000
committerNico Weber <nicolasweber@gmx.de>2012-05-20 01:27:21 +0000
commit11d1a697dcf677c42394dfa9506ace4935f3b00d (patch)
treeb009a8d243dabc71ec7c4a6b8f0f19c1b06b56ee /lib/Sema/SemaExprCXX.cpp
parenta2ac407e285290508c86baa358a0c011ce6f8958 (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.cpp4
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) {