Navigation Menu

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

Add pedantic checking for constant expressions to clang #4774

Open
efriedma-quic opened this issue Jun 17, 2009 · 3 comments
Open

Add pedantic checking for constant expressions to clang #4774

efriedma-quic opened this issue Jun 17, 2009 · 3 comments
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"

Comments

@efriedma-quic
Copy link
Collaborator

Bugzilla Link 4402
Version unspecified
OS Linux
CC @hvdijk

Extended Description

From Sema::CheckForConstantInitializer:
// FIXME: Need strict checking. In C89, we need to check for
// any assignment, increment, decrement, function-calls, or
// commas outside of a sizeof. In C99, it's the same list,
// except that the aforementioned are allowed in unevaluated
// expressions. Everything else falls under the
// "may accept other forms of constant expressions" exception.
// (We never end up here for C++, so the constant expression
// rules there don't matter.)

Filing here for completeness. This is relatively low-priority because it's a non-trivial amount of work, and it's a warning nobody would care about outside of -pedantic mode.

@llvmbot
Copy link
Collaborator

llvmbot commented Jun 19, 2012

*** Bug #4678 has been marked as a duplicate of this bug. ***

@zygoloid
Copy link
Mannequin

zygoloid mannequin commented Mar 15, 2021

*** Bug llvm/llvm-bugzilla-archive#49581 has been marked as a duplicate of this bug. ***

@zygoloid
Copy link
Mannequin

zygoloid mannequin commented Nov 27, 2021

mentioned in issue llvm/llvm-bugzilla-archive#49581

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
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:frontend Language frontend issues, e.g. anything involving "Sema"
Projects
None yet
Development

No branches or pull requests

2 participants