aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-05-23 19:43:23 +0000
committerDouglas Gregor <dgregor@apple.com>2010-05-23 19:43:23 +0000
commit9ba6af8bedba28d10a6906c62c19d43f81c5d386 (patch)
treece6ec330d3add11515ebd07fc441ab262211e1bc /lib
parent928e6fcf66fc4f342bcf7cc96bf56986c9c2a833 (diff)
Complain about sizeof(overloaded function) rather than crashing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104470 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Sema/SemaExpr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 0c150ffeed..5e2e732572 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -2027,6 +2027,12 @@ bool Sema::CheckSizeOfAlignOfOperand(QualType exprType,
return true;
}
+ if (Context.hasSameUnqualifiedType(exprType, Context.OverloadTy)) {
+ Diag(OpLoc, diag::err_sizeof_alignof_overloaded_function_type)
+ << !isSizeof << ExprRange;
+ return true;
+ }
+
return false;
}