[clang][cli] Fix build failure in CompilerInvocation

There is a report that https://reviews.llvm.org/D96280 causes a build failure with error: too few template arguments for class template 'SmallVector'. This patch attempts to fix that by explicitly specifying N for SmallVector<T, N>.
This commit is contained in:
Jan Svoboda 2021-02-26 12:54:42 +01:00
parent 406ef36b03
commit 8dc70bdcd0
1 changed files with 2 additions and 2 deletions

View File

@ -663,7 +663,7 @@ static bool RoundTrip(ParseFn Parse, GenerateFn Generate,
// Generate arguments from the dummy invocation. If Generate is the // Generate arguments from the dummy invocation. If Generate is the
// inverse of Parse, the newly generated arguments must have the same // inverse of Parse, the newly generated arguments must have the same
// semantics as the original. // semantics as the original.
SmallVector<const char *> GeneratedArgs1; SmallVector<const char *, 16> GeneratedArgs1;
Generate(DummyInvocation, GeneratedArgs1, SA); Generate(DummyInvocation, GeneratedArgs1, SA);
// Run the second parse, now on the generated arguments, and with the real // Run the second parse, now on the generated arguments, and with the real
@ -683,7 +683,7 @@ static bool RoundTrip(ParseFn Parse, GenerateFn Generate,
// Generate arguments again, this time from the options we will end up using // Generate arguments again, this time from the options we will end up using
// for the rest of the compilation. // for the rest of the compilation.
SmallVector<const char *> GeneratedArgs2; SmallVector<const char *, 16> GeneratedArgs2;
Generate(RealInvocation, GeneratedArgs2, SA); Generate(RealInvocation, GeneratedArgs2, SA);
// Compares two lists of generated arguments. // Compares two lists of generated arguments.