// RUN: %clang_cc1 -std=c++17 -fopenmp -fopenmp-version=51 -fsyntax-only -verify %s
// This file tests the custom parsing logic for the OpenMP 5.1 attribute
// syntax. It does not test actual OpenMP directive syntax, just the attribute
// parsing bits.
// FIXME: the diagnostic here is a bit unsatisfying. We handle the custom omp
// attribute parsing logic when parsing the attribute argument list, and we
// only process an attribute argument list when we see an open paren after the
// attribute name. So this means we never hit the omp-specific parsing and
// instead handle this through the usual Sema attribute handling in
// SemaDeclAttr.cpp, which diagnoses this as an unknown attribute.
; // expected-warning {{unknown attribute 'directive' ignored}}
; // expected-warning {{unknown attribute 'sequence' ignored}}
; // expected-warning {{unknown attribute 'unknown' ignored}}
; // expected-error {{expected an OpenMP directive}}
; // expected-error {{expected an OpenMP 'directive' or 'sequence' attribute argument}}
// Both sequence and directive require an argument list, test that we diagnose
// when the inner directive or sequence is missing its argument list.
; // expected-error {{expected '('}}
; // expected-error {{expected '('}}
; // expected-error {{expected '('}}
; // expected-error {{expected '('}}
// All of the diagnostics here come from the inner sequence and directive not
// being given an argument, but this tests that we can parse either with or
// without the 'omp::'.
; // expected-error {{expected an OpenMP directive}} expected-error {{expected an OpenMP 'directive' or 'sequence' attribute argument}}
; // expected-error {{expected an OpenMP directive}} expected-error {{expected an OpenMP 'directive' or 'sequence' attribute argument}}
; // expected-error {{expected an OpenMP directive}} expected-error {{expected an OpenMP 'directive' or 'sequence' attribute argument}}
; // expected-error {{expected an OpenMP directive}} expected-error {{expected an OpenMP 'directive' or 'sequence' attribute argument}}
// Test that we properly diagnose missing parens within the inner arguments of
// a sequence attribute.