forked from OSchip/llvm-project
A '<' with a trigraph '#' is not a valid editor placeholder
Credit to OSS-Fuzz for discovery: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3137#c5 rdar://34923985 llvm-svn: 315398
This commit is contained in:
parent
18057cb34c
commit
c1e32fca96
|
@ -3542,7 +3542,8 @@ LexNextToken:
|
|||
} else if (LangOpts.Digraphs && Char == '%') { // '<%' -> '{'
|
||||
CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
|
||||
Kind = tok::l_brace;
|
||||
} else if (Char == '#' && lexEditorPlaceholder(Result, CurPtr)) {
|
||||
} else if (Char == '#' && /*Not a trigraph*/ SizeTmp == 1 &&
|
||||
lexEditorPlaceholder(Result, CurPtr)) {
|
||||
return true;
|
||||
} else {
|
||||
Kind = tok::less;
|
||||
|
|
|
@ -69,3 +69,7 @@ void Struct::method(<#Struct &x#>, noSupressionHere) { // expected-error {{unkno
|
|||
// expected-error@-2 {{editor placeholder in source file}}
|
||||
#endif
|
||||
}
|
||||
|
||||
void handleTrigraph() {
|
||||
<??=placeholder#> // expected-error {{expected expression}} expected-error {{expected expression}} expected-warning {{trigraph converted to '#' character}}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue