forked from OSchip/llvm-project
Add missing clang-format null pointer check..
.. and a test that triggers it in valid albeit questionable code. llvm-svn: 175554
This commit is contained in:
parent
0186347c4c
commit
6db1b7ca16
|
@ -592,7 +592,8 @@ private:
|
|||
else
|
||||
Current.Type = TT_BlockComment;
|
||||
} else if (Current.is(tok::r_paren)) {
|
||||
bool ParensNotExpr = Current.Parent->Type == TT_PointerOrReference ||
|
||||
bool ParensNotExpr = !Current.Parent ||
|
||||
Current.Parent->Type == TT_PointerOrReference ||
|
||||
Current.Parent->Type == TT_TemplateCloser;
|
||||
bool ParensCouldEndDecl =
|
||||
!Current.Children.empty() && (Current.Children[0].is(tok::equal) ||
|
||||
|
|
|
@ -937,6 +937,8 @@ TEST_F(FormatTest, MacroDefinitionsWithIncompleteCode) {
|
|||
getLLVMStyleWithColumns(20));
|
||||
|
||||
verifyFormat("#define A template <typename T>");
|
||||
verifyFormat("#define STR(x) #x\n"
|
||||
"f(STR(this_is_a_string_literal{));");
|
||||
}
|
||||
|
||||
TEST_F(FormatTest, IndentPreprocessorDirectivesAtZero) {
|
||||
|
|
Loading…
Reference in New Issue