Skip to content

Commit e3110ad

Browse files
committed
address Erich's feedback
1 parent dae88ea commit e3110ad

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

clang/lib/Lex/PPExpressions.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ getCXXStandardLibraryVersion(Preprocessor &PP, StringRef MacroName,
985985
CXXStandardLibraryVersionInfo::Library Lib) {
986986
MacroInfo *Macro = PP.getMacroInfo(PP.getIdentifierInfo(MacroName));
987987

988-
if (!Macro || Macro->getNumTokens() != 1)
988+
if (!Macro || Macro->getNumTokens() != 1 || !Macro->isObjectLike())
989989
return std::nullopt;
990990

991991
const Token &RevisionDateTok = Macro->getReplacementToken(0);
@@ -998,8 +998,7 @@ getCXXStandardLibraryVersion(Preprocessor &PP, StringRef MacroName,
998998
unsigned Value;
999999
// We don't use NumericParser to avoid diagnostics
10001000
if (!RevisionDate.consumeInteger(10, Value))
1001-
return CXXStandardLibraryVersionInfo{
1002-
CXXStandardLibraryVersionInfo::LibStdCXX, Value};
1001+
return CXXStandardLibraryVersionInfo{Lib, Value};
10031002
}
10041003
return CXXStandardLibraryVersionInfo{CXXStandardLibraryVersionInfo::Unknown,
10051004
0};

0 commit comments

Comments
 (0)