// RUN: %clang_cc1 -verify=all,c2x -std=c2x -fsyntax-only %s
// RUN: %clang_cc1 -verify=all -std=c17 -fdouble-square-bracket-attributes -fsyntax-only %s
// RUN: %clang_cc1 -verify=none -Wno-deprecated-attributes -D_CLANG_DISABLE_CRT_DEPRECATION_WARNINGS -std=c2x -fsyntax-only %s
// RUN: %clang_cc1 -verify=none -Wno-deprecated-attributes -D_CLANG_DISABLE_CRT_DEPRECATION_WARNINGS -std=c17 -fdouble-square-bracket-attributes -fsyntax-only %s
// none-no-diagnostics
// Test preprocessor functionality.
// If we're testings with deprecations disabled, we don't care about testing
// the scenarios that trigger errors because we're only interested in the
// deprecation warning behaviors.
// Test that the attribute accepts no args, applies to the correct subject, etc.
void ; // all-error {{attribute 'noreturn' cannot have an argument list}}
int not_a_func; // all-error {{'noreturn' attribute only applies to functions}}
void ; // all-error {{'noreturn' attribute cannot be applied to types}}
_Noreturn void ; // ok, using the function specifier
void ;
// This is deprecated because it's only for compatibility with inclusion of the
// <stdnoreturn.h> header where the noreturn macro expands to _Noreturn.
void ; // all-warning {{the '[[_Noreturn]]' attribute spelling is deprecated in C2x; use '[[noreturn]]' instead}}
// Test the behavior of including <stdnoreturn.h>
void ;
void func7 ;
noreturn void ;
// Ensure the function specifier form still works.
void noreturn ;
// Ensure that spelling the deprecated form of the attribute is still diagnosed.
void ; // all-warning {{the '[[_Noreturn]]' attribute spelling is deprecated in C2x; use '[[noreturn]]' instead}}
// Test preprocessor functionality after including <stdnoreturn.h>.
// Test that a macro which expands to _Noreturn is still diagnosed when it
// doesn't come from a system header.
void ; // all-warning {{the '[[_Noreturn]]' attribute spelling is deprecated in C2x; use '[[noreturn]]' instead}}