Comparing C++ dialects


In the cross translation unit lib, I'd like to compare the C++
language dialects of two TUs. If they are different then CrossTU
should be disabled (⚙ D57906 [CTU] Do not allow different CPP dialects in CTU)
However, comparing the dialects is prone for errors in the future:

  if (LangTo.CPlusPlus11 != LangFrom.CPlusPlus11 ||
      LangTo.CPlusPlus14 != LangFrom.CPlusPlus14 ||
      LangTo.CPlusPlus17 != LangFrom.CPlusPlus17 ||
      LangTo.CPlusPlus2a != LangFrom.CPlusPlus2a) {
    return llvm::make_error<IndexError>(

Ideally, we should have a test case which fails when CPlusPlus23 (2b
or whatever) is introduced.
Do you guys could advise how to achieve this?

Thanks for your help,