erichkeane 65a9a3d5b1 [OpenACC] Fix asserts when checking clauses after invalid directive
When implementing the parsing for OpenACC I ensured that we could always
continue to do diagnostics/etc.  For the most part, I was consistent
with that assumption throughout clause Sema, but in 3 cases I left in
some unreachables for cases where this would happen. I've now properly
handled all 3 in a reasonable way.

Fixes: #139894
2025-05-14 07:03:16 -07:00

15 lines
477 B
C++

// RUN: %clang_cc1 %s -fopenacc -verify
// Ensure that these don't assert, they previously assumed that their directive
// kind would be valid, but we should make sure that we handle that gracefully
// in cases where they don't.
// expected-error@+1{{invalid OpenACC directive 'foo'}}
#pragma acc foo gang(1)
// expected-error@+1{{invalid OpenACC directive 'foo'}}
#pragma acc foo vector(1)
// expected-error@+1{{invalid OpenACC directive 'foo'}}
#pragma acc foo worker(1)