Skip to content
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

#pragma clang diagnostic push ignores garbage at end of line without warning #13920

Closed
llvmbot opened this issue Aug 8, 2012 · 1 comment
Closed
Labels
bugzilla Issues migrated from bugzilla clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer confirmed Verified by a second party

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Aug 8, 2012

Bugzilla Link 13548
Version 3.1
OS MacOS X
Reporter LLVM Bugzilla Contributor

Extended Description

I blithely wrote the following code:

#pragma clang diagnostic push ignored "-Wdeprecated-declarations"

Which should not be expected to work, nor is it documented to. Owing to a mental scotoma I could not comprehend why deprecated-declaration warning continued to be issued.
As it happens you can put nigh anything at the end of the line and the compiler will silently ignore it.

If the compiler had warned about the garbage, it would have saved me some mental anguish. Perhaps we need to add -Wextra-stuff-at-end-of-pragma. Or perhaps we don't need to make that one optional.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
@Quuxplusone Quuxplusone added the clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer label Jan 17, 2022
@Endilll Endilll added the confirmed Verified by a second party label May 21, 2023
@Endilll
Copy link
Contributor

Endilll commented May 21, 2023

Nothing has changed as of Clang 16: https://godbolt.org/z/3sbWdeK6r

@EugeneZelenko EugeneZelenko removed the clang:frontend Language frontend issues, e.g. anything involving "Sema" label Jun 26, 2023
Chenyang-L pushed a commit to intel/llvm that referenced this issue Jul 11, 2023
We would previously fail to diagnose unexpected tokens after a 'push'
or 'pop' directive.

Fixes llvm/llvm-project#13920
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer confirmed Verified by a second party
Projects
None yet
Development

No branches or pull requests

4 participants