Bug 32301 - Add "using std::foo" rule checked by script to coding style guidelines
Summary: Add "using std::foo" rule checked by script to coding style guidelines
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Website (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P4 Minor
Assignee: Nobody
URL: https://lists.webkit.org/pipermail/we...
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-08 19:40 PST by Chris Jerdonek
Modified: 2009-12-09 15:09 PST (History)
3 users (show)

See Also:


Attachments
Proposed patch (3.11 KB, patch)
2009-12-08 20:00 PST, Chris Jerdonek
darin: review+
Details | Formatted Diff | Diff
Revised patch (3.11 KB, patch)
2009-12-09 10:16 PST, Chris Jerdonek
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Jerdonek 2009-12-08 19:40:36 PST
This is a bug report to make the following changes and clarifications to the coding style guidelines:

(1) Add this to the guidelines: Do not use statements of the form
"using std:foo" in implementation files.  Use "using namespace std"
instead.  (The script currently enforces this rule, but for header
files and not just implementation files.)

(2) Clarify that the rule to put "using namespace" statements near the
beginning of a file applies only to implementation files. (It
currently applies also to header files.)  Also, strengthen the rule so
it applies to all "using" statements in implementation files and not
just "using namespace" statements.

(The above is excerpted from an e-mail to the webkit-dev list -- linked to by the URL for this report.)
Comment 1 Chris Jerdonek 2009-12-08 20:00:36 PST
Created attachment 44509 [details]
Proposed patch

Changes made as reported.

Also, all the "using" statement style guidelines now lead with "In header files" or "In implementation files," etc. so it is immediately obvious what types of files each rule applies to.
Comment 2 WebKit Review Bot 2009-12-08 20:05:20 PST
style-queue ran check-webkit-style on attachment 44509 [details] without any errors.
Comment 3 Darin Adler 2009-12-09 09:31:44 PST
Comment on attachment 44509 [details]
Proposed patch

> +<li>In header files in the WTF sub-library, however, it is acceptable
> +to use "using" declarations at the end of the file to include one
> +or more names in the WTF namespace into the global scope.

I think the use of the verb "include" here is strange. I think it should be "add" or "import" instead.
Comment 4 Chris Jerdonek 2009-12-09 10:16:38 PST
Created attachment 44543 [details]
Revised patch

Changed the two uses of "include" to "import" -- as suggested.
Comment 5 WebKit Review Bot 2009-12-09 10:19:49 PST
style-queue ran check-webkit-style on attachment 44543 [details] without any errors.
Comment 6 WebKit Commit Bot 2009-12-09 15:08:55 PST
Comment on attachment 44543 [details]
Revised patch

Clearing flags on attachment: 44543

Committed r51929: <http://trac.webkit.org/changeset/51929>
Comment 7 WebKit Commit Bot 2009-12-09 15:09:01 PST
All reviewed patches have been landed.  Closing bug.