aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaCast.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2011-10-18 20:49:44 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2011-10-18 20:49:44 +0000
commitebaf0e6ab743394dda086a01b457838cb6e589a8 (patch)
tree731d496e1c1d0b3247aea91eaf79c4aee5be86fc /lib/Sema/SemaCast.cpp
parent024f4be866d13dd2b0ec062e694a62ca84c37191 (diff)
-Wc++98-compat and -Wc++98-compat-pedantic warnings for Sema, part 1.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142419 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCast.cpp')
-rw-r--r--lib/Sema/SemaCast.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Sema/SemaCast.cpp b/lib/Sema/SemaCast.cpp
index 925f468cfd..7a063036c2 100644
--- a/lib/Sema/SemaCast.cpp
+++ b/lib/Sema/SemaCast.cpp
@@ -1712,15 +1712,19 @@ static TryCastResult TryReinterpretCast(Sema &Self, ExprResult &SrcExpr,
// casting the return value of dlsym() and GetProcAddress().
// FIXME: Conditionally-supported behavior should be configurable in the
// TargetInfo or similar.
- if (!Self.getLangOptions().CPlusPlus0x)
- Self.Diag(OpRange.getBegin(), diag::ext_cast_fn_obj) << OpRange;
+ Self.Diag(OpRange.getBegin(),
+ Self.getLangOptions().CPlusPlus0x ?
+ diag::warn_cxx98_compat_cast_fn_obj : diag::ext_cast_fn_obj)
+ << OpRange;
return TC_Success;
}
if (DestType->isFunctionPointerType()) {
// See above.
- if (!Self.getLangOptions().CPlusPlus0x)
- Self.Diag(OpRange.getBegin(), diag::ext_cast_fn_obj) << OpRange;
+ Self.Diag(OpRange.getBegin(),
+ Self.getLangOptions().CPlusPlus0x ?
+ diag::warn_cxx98_compat_cast_fn_obj : diag::ext_cast_fn_obj)
+ << OpRange;
return TC_Success;
}