aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-04-26 01:51:03 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-04-26 01:51:03 +0000
commit86e6fdcf1a04edc4c24f53f9dbacf7e1b52f306d (patch)
tree258014dbd2c591df9ec3a7af3447ecb8219d0674 /lib/Sema/SemaExprCXX.cpp
parent45a0b264512ee0e9ba874bb3bfeb7f5b96789117 (diff)
Two missing -Wc++98-compat warnings, for null pointers as non-type template
arguments, and 'this' in exception-specifications. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155606 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 af0f971c1c..7d345073d7 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -693,6 +693,10 @@ Sema::CXXThisScopeRAII::~CXXThisScopeRAII() {
}
void Sema::CheckCXXThisCapture(SourceLocation Loc, bool Explicit) {
+ if (getLangOpts().CPlusPlus0x &&
+ !dyn_cast_or_null<CXXMethodDecl>(getFunctionLevelDeclContext()))
+ Diag(Loc, diag::warn_cxx98_compat_this_outside_method);
+
// We don't need to capture this in an unevaluated context.
if (ExprEvalContexts.back().Context == Unevaluated && !Explicit)
return;