Skip to content

Commit cafc064

Browse files
committed
[clang] NFC: small formatting and stray whitespace cleanup
Formats `Expr::HasSideEffects` because incorrect identation of block end token makes clang-format go haywire in patch mode. Also removes stray whitespace from a test file.
1 parent 722b251 commit cafc064

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

clang/lib/AST/Expr.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3672,10 +3672,10 @@ bool Expr::HasSideEffects(const ASTContext &Ctx,
36723672

36733673
switch (getStmtClass()) {
36743674
case NoStmtClass:
3675-
#define ABSTRACT_STMT(Type)
3676-
#define STMT(Type, Base) case Type##Class:
3677-
#define EXPR(Type, Base)
3678-
#include "clang/AST/StmtNodes.inc"
3675+
#define ABSTRACT_STMT(Type)
3676+
#define STMT(Type, Base) case Type##Class:
3677+
#define EXPR(Type, Base)
3678+
#include "clang/AST/StmtNodes.inc"
36793679
llvm_unreachable("unexpected Expr kind");
36803680

36813681
case DependentScopeDeclRefExprClass:
@@ -3831,8 +3831,8 @@ bool Expr::HasSideEffects(const ASTContext &Ctx,
38313831
break;
38323832

38333833
case GenericSelectionExprClass:
3834-
return cast<GenericSelectionExpr>(this)->getResultExpr()->
3835-
HasSideEffects(Ctx, IncludePossibleEffects);
3834+
return cast<GenericSelectionExpr>(this)->getResultExpr()->HasSideEffects(
3835+
Ctx, IncludePossibleEffects);
38363836

38373837
case ChooseExprClass:
38383838
return cast<ChooseExpr>(this)->getChosenSubExpr()->HasSideEffects(
@@ -3856,7 +3856,7 @@ bool Expr::HasSideEffects(const ASTContext &Ctx,
38563856
if (DCE->getTypeAsWritten()->isReferenceType() &&
38573857
DCE->getCastKind() == CK_Dynamic)
38583858
return true;
3859-
}
3859+
}
38603860
[[fallthrough]];
38613861
case ImplicitCastExprClass:
38623862
case CStyleCastExprClass:
@@ -3945,7 +3945,7 @@ bool Expr::HasSideEffects(const ASTContext &Ctx,
39453945
case ObjCBridgedCastExprClass:
39463946
case ObjCMessageExprClass:
39473947
case ObjCPropertyRefExprClass:
3948-
// FIXME: Classify these cases better.
3948+
// FIXME: Classify these cases better.
39493949
if (IncludePossibleEffects)
39503950
return true;
39513951
break;

clang/test/SemaCXX/delete-and-function-templates.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %clang_cc1 -std=c++11 -verify -emit-llvm-only %s
2-
// RUN: %clang_cc1 -std=c++11 -verify -fsyntax-only -fdelayed-template-parsing %s
3-
// RUN: %clang_cc1 -std=c++11 -verify -fsyntax-only -fms-extensions %s
4-
// RUN: %clang_cc1 -std=c++11 -verify -fsyntax-only -fdelayed-template-parsing -fms-extensions %s
2+
// RUN: %clang_cc1 -std=c++11 -verify -fsyntax-only -fdelayed-template-parsing %s
3+
// RUN: %clang_cc1 -std=c++11 -verify -fsyntax-only -fms-extensions %s
4+
// RUN: %clang_cc1 -std=c++11 -verify -fsyntax-only -fdelayed-template-parsing -fms-extensions %s
55

66
template<class T, class U> struct is_same { enum { value = false }; };
77
template<class T> struct is_same<T, T> { enum { value = true }; };
@@ -53,7 +53,7 @@ namespace test_explicit_specialization_of_member {
5353
namespace ns1 {
5454
template<class T> struct X {
5555
int* f(T) = delete;
56-
};
56+
};
5757
template<> int* X<int>::f(int) { }
5858

5959
template<class T> decltype(X<T>{}.f(T{})) g(T); // expected-note{{candidate}}
@@ -69,7 +69,7 @@ void foo() {
6969
namespace ns2 {
7070
struct X {
7171
template<class T> double* f(T) = delete;
72-
};
72+
};
7373
template<> double* X::f(int);
7474

7575
template<class T> decltype(X{}.f(T{})) g(T); // expected-note{{candidate}}
@@ -105,8 +105,8 @@ void foo() {
105105
int *ip4 = g2(3, 3); //expected-error{{ambiguous}}
106106
}
107107
{
108-
int *ip3 = g2(3.14, 3.14);
109-
int *ip4 = g2(3, 3.14);
108+
int *ip3 = g2(3.14, 3.14);
109+
int *ip4 = g2(3, 3.14);
110110
}
111111
}
112112

0 commit comments

Comments
 (0)