Skip to content

[clang-tidy] Add avoid-pragma-once. #140388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

dl8sd11
Copy link
Contributor

@dl8sd11 dl8sd11 commented May 17, 2025

Copy link

github-actions bot commented May 17, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

// RUN: -- -- -isystem %S/Inputs/avoid-pragma-once

#include <lib.h>
// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: Avoid pragma once. [portability-avoid-pragma-once]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm new to writing tests for header files. I got the following error. Is there a suggestion for this? Thanks!

Input was:
<<<<<<
           1: 1 warning generated.
check:5'0     X~~~~~~~~~~~~~~~~~~~~ error: no match found
check:5'1                           with "@LINE-1" equal to "4"
           2: Suppressed 1 warnings (1 in non-user code).
check:5'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:5'2              ?                                   possible intended match
           3: Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
check:5'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>>>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants