Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

"one-line" change to clang still causes acceptance of incorrect code #33

Open
dhollman opened this issue Nov 11, 2017 · 2 comments
Open

Comments

@dhollman
Copy link
Contributor

The "one-line" change to clang (as far as I can tell) that we referenced in the [][] paper is this one (in commit b7b9efb) on the clang github). There are still substantial things that don't work even with that change, though; for instance:

#include <cstdlib>
#include <iostream>

// This *SHOULDN'T* work
void test(int[][][5][][]) {
  cout << "called foo(int[][][5][][])" << endl;
}

int main(int argc, char** argv)
{
  test(*(int(*)[][][5][][])&i);
}
@tkoeppe
Copy link

tkoeppe commented Nov 11, 2017

On that note, I would also recommend striking the "trivial, non-breaking" language from the introduction. The issue is more complex than such wording would suggest (as has repeatedly emerged in EWG discussions). It might make a better impression if you make clear that this proposal requires some thought and care and that you think it's worth it, than if it looks like the proposal underestimates its own complexity.

@hcedwar
Copy link
Contributor

hcedwar commented Nov 14, 2017

@tkoeppe : We are systematically identifying the issues that must be addressed. At this point the complexity appears to be a breadth issue, not a depth issue. Primarily identifying those places where it is assumed (and sometimes stated) that the decay of an incomplete array type is a complete type. For this proposal the decay may or may not be complete.

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

No branches or pull requests

3 participants