File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -2365,11 +2365,14 @@ tooling::Replacements sortUsingDeclarations(const FormatStyle &Style,
2365
2365
2366
2366
LangOptions getFormattingLangOpts (const FormatStyle &Style ) {
2367
2367
LangOptions LangOpts;
2368
+ FormatStyle::LanguageStandard LexingStd =
2369
+ Style .Standard == FormatStyle::LS_Auto ? FormatStyle::LS_Cpp11
2370
+ : Style .Standard ;
2368
2371
LangOpts.CPlusPlus = 1 ;
2369
- LangOpts.CPlusPlus11 = Style . Standard >= FormatStyle::LS_Cpp11;
2370
- LangOpts.CPlusPlus14 = Style . Standard >= FormatStyle::LS_Cpp11;
2371
- LangOpts.CPlusPlus17 = Style . Standard >= FormatStyle::LS_Cpp11;
2372
- LangOpts.CPlusPlus2a = Style . Standard >= FormatStyle::LS_Cpp11;
2372
+ LangOpts.CPlusPlus11 = LexingStd >= FormatStyle::LS_Cpp11;
2373
+ LangOpts.CPlusPlus14 = LexingStd >= FormatStyle::LS_Cpp11;
2374
+ LangOpts.CPlusPlus17 = LexingStd >= FormatStyle::LS_Cpp11;
2375
+ LangOpts.CPlusPlus2a = LexingStd >= FormatStyle::LS_Cpp11;
2373
2376
LangOpts.LineComment = 1 ;
2374
2377
bool AlternativeOperators = Style .isCpp ();
2375
2378
LangOpts.CXXOperatorNames = AlternativeOperators ? 1 : 0 ;
You can’t perform that action at this time.
0 commit comments