[cfe-commits] r62926 - /cfe/trunk/lib/Sema/SemaExpr.cpp
Chris Lattner
sabre at nondot.org
Sat Jan 24 11:46:37 PST 2009
Author: lattner
Date: Sat Jan 24 13:46:37 2009
New Revision: 62926
URL: http://llvm.org/viewvc/llvm-project?rev=62926&view=rev
Log:
minor formatting changes, no functionality change.
Modified:
cfe/trunk/lib/Sema/SemaExpr.cpp
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=62926&r1=62925&r2=62926&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Sat Jan 24 13:46:37 2009
@@ -1016,19 +1016,23 @@
const SourceRange &ExprRange,
bool isSizeof) {
// C99 6.5.3.4p1:
- if (isa<FunctionType>(exprType) && isSizeof)
+ if (isa<FunctionType>(exprType)) {
// alignof(function) is allowed.
- Diag(OpLoc, diag::ext_sizeof_function_type) << ExprRange;
- else if (exprType->isVoidType())
+ if (isSizeof)
+ Diag(OpLoc, diag::ext_sizeof_function_type) << ExprRange;
+ return false;
+ }
+
+ if (exprType->isVoidType()) {
Diag(OpLoc, diag::ext_sizeof_void_type)
<< (isSizeof ? "sizeof" : "__alignof") << ExprRange;
- else
- return DiagnoseIncompleteType(OpLoc, exprType,
- isSizeof ? diag::err_sizeof_incomplete_type :
- diag::err_alignof_incomplete_type,
- ExprRange);
+ return false;
+ }
- return false;
+ return DiagnoseIncompleteType(OpLoc, exprType,
+ isSizeof ? diag::err_sizeof_incomplete_type :
+ diag::err_alignof_incomplete_type,
+ ExprRange);
}
/// ActOnSizeOfAlignOfExpr - Handle @c sizeof(type) and @c sizeof @c expr and
@@ -1059,8 +1063,8 @@
// C99 6.5.3.4p4: the type (an unsigned integer type) is size_t.
return Owned(new (Context) SizeOfAlignOfExpr(isSizeof, isType, TyOrEx,
- Context.getSizeType(), OpLoc,
- Range.getEnd()));
+ Context.getSizeType(), OpLoc,
+ Range.getEnd()));
}
QualType Sema::CheckRealImagOperand(Expr *&V, SourceLocation Loc) {
More information about the cfe-commits
mailing list