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

[diff.expr] replace "declare" with "define" #389

Merged
merged 1 commit into from Mar 7, 2016

Conversation

cpplearner
Copy link
Contributor

It is always legal in C++ to declare new types in a sizeof expression or cast expression, but you can't define a new type in an expression.

It is always legal in C++ to declare new types in a sizeof expression or cast expression, but you can't *define* a new type in an expression.
@FrankHB
Copy link
Contributor

FrankHB commented Oct 18, 2014

I don't find anything wrong of the original wording. A definition is always a declaration in C++. And is it really always legal, e.g. typedef? Note: a typedef name is introduced by a definition in C, but a declaration which is not a definition in C++.

@zygoloid
Copy link
Member

The original wording is indeed incorrect, and the suggested change is an improvement. The cross-references to 5.3.3 and 5.4 are also wrong here; the rule is in 7.1.6. There's a collection of other formatting issues near here that I'd also like to fix; I'd like to take a broader look.

@jwakely
Copy link
Member

jwakely commented Jan 5, 2016

@zygoloid should we merge this as is, since it doesn't make anything worse, and is an improvement?

zygoloid added a commit that referenced this pull request Mar 7, 2016
[diff.expr] Fix incorrect description of difference between C and C++: it is possible to declare, but (unlike C) not define, new types within expressions in C++.
@zygoloid zygoloid merged commit 8efdafb into cplusplus:master Mar 7, 2016
@cpplearner cpplearner deleted the patch-1 branch March 7, 2016 23:18
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.

None yet

4 participants