================ @@ -91,10 +140,19 @@ OpenACCDirectiveKind ParseOpenACCDirectiveKind(Parser &P) { P.ConsumeToken(); std::string FirstTokSpelling = P.getPreprocessor().getSpelling(FirstTok); - OpenACCDirectiveKind DirKind = getOpenACCDirectiveKind(FirstTokSpelling); + OpenACCDirectiveKindEx ExDirKind = getOpenACCDirectiveKind(FirstTokSpelling); + + switch (ExDirKind) { + case OpenACCDirectiveKindEx::Invalid: + P.Diag(FirstTok, diag::err_acc_invalid_directive) << 0 << FirstTokSpelling; + return OpenACCDirectiveKind::Invalid; + case OpenACCDirectiveKindEx::Enter: + case OpenACCDirectiveKindEx::Exit: + return ParseOpenACCEnterExitDataDirective(P, FirstTok, FirstTokSpelling, + ExDirKind); + } ---------------- erichkeane wrote:
The switch doesn't actually cover all values, the intent is that `OpenACCDirectiveKindEx` can contain an `OpenACCDirectiveKind`, OR one of the extended values. So `ExDirKind` can be a bunch of other values, so if the kind is any one of the others (like parallel), it will go through this switch and fall to the below ones. https://github.com/llvm/llvm-project/pull/72916 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits