Skip to content

Example cannot be compiled#221

Closed
yihonglyu wants to merge 1 commit intoMicrosoftDocs:masterfrom
yihonglyu:patch-1
Closed

Example cannot be compiled#221
yihonglyu wants to merge 1 commit intoMicrosoftDocs:masterfrom
yihonglyu:patch-1

Conversation

@yihonglyu
Copy link
Copy Markdown

There are some errors of the doc. The code cannot be compiled:

$ cat error.cpp
const int some_object = 5 ;
int volatile *const z = &some_object;

$ gcc -c error.cpp
error.cpp:2:26: error: invalid conversion from ‘const int*’ to ‘volatile int*’ [-fpermissive]
int volatile *const z = &some_object;
^

There are some errors of the doc. The code cannot be compiled:

$ cat error.cpp
const int some_object = 5 ;
int volatile *const z = &some_object;

$ gcc -c error.cpp
error.cpp:2:26: error: invalid conversion from ‘const int*’ to ‘volatile int*’ [-fpermissive]
 int volatile *const z = &some_object;
                          ^
@PRMerger13
Copy link
Copy Markdown
Contributor

@lyh-kernel : Thanks for your contribution! The author, @mikeblome, has been notified to review your proposed change.

@mikeblome
Copy link
Copy Markdown
Contributor

Thanks @lyh-kernel! This compiles with latest MSVC so I'm following up with compiler team.

@mikeblome mikeblome closed this Sep 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants