[Bug c++/41518] copy initialization of volatile objects

2023-07-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41518

Andrew Pinski  changed:

   What|Removed |Added

 CC||irip at qq dot com

--- Comment #7 from Andrew Pinski  ---
*** Bug 110685 has been marked as a duplicate of this bug. ***

[Bug c++/41518] copy initialization of volatile objects

2021-07-23 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41518

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |FIXED
   Target Milestone|--- |4.9.1
 Status|NEW |RESOLVED

--- Comment #6 from Andrew Pinski  ---
Fixed in GCC 4.9.1.

[Bug c++/41518] copy initialization of volatile objects

2012-02-15 Thread jason at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41518

--- Comment #5 from Jason Merrill  2012-02-15 
19:49:29 UTC ---
I agree with the analysis.


[Bug c++/41518] copy initialization of volatile objects

2012-02-15 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41518

Paolo Carlini  changed:

   What|Removed |Added

 CC|gcc-bugs at gcc dot gnu.org |jason at gcc dot gnu.org

--- Comment #4 from Paolo Carlini  2012-02-15 
16:04:41 UTC ---
Let's ask Jason to double check the triage.


[Bug c++/41518] copy initialization of volatile objects

2012-02-15 Thread lucdanton at free dot fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41518

lucdanton at free dot fr changed:

   What|Removed |Added

 CC||lucdanton at free dot fr

--- Comment #3 from lucdanton at free dot fr 2012-02-15 15:08:11 UTC ---
Reproducible with const:

$ cat main.cpp
struct copyable {
copyable() {}
copyable(copyable&) {}
};

struct wrapper {
copyable c;

wrapper(int) {}
};

int
main()
{
wrapper const w = 0;
}

$ g++-snapshot -Wall -Wextra -pedantic main.cpp 
main.cpp: In function 'int main()':
main.cpp:15:23: error: no matching function for call to 'wrapper::wrapper(const
wrapper)'
main.cpp:15:23: note: candidates are:
main.cpp:9:5: note: wrapper::wrapper(int)
main.cpp:9:5: note:   no known conversion for argument 1 from 'const wrapper'
to 'int'
main.cpp:6:8: note: wrapper::wrapper(wrapper&)
main.cpp:6:8: note:   no known conversion for argument 1 from 'const wrapper'
to 'wrapper&'

$ g++-snapshot -Wall -Wextra -pedantic -std=c++11 main.cpp  
main.cpp: In function 'int main()':
main.cpp:15:23: error: no matching function for call to 'wrapper::wrapper(const
wrapper)'
main.cpp:15:23: note: candidates are:
main.cpp:9:5: note: wrapper::wrapper(int)
main.cpp:9:5: note:   no known conversion for argument 1 from 'const wrapper'
to 'int'
main.cpp:6:8: note: wrapper::wrapper(wrapper&)
main.cpp:6:8: note:   no known conversion for argument 1 from 'const wrapper'
to 'wrapper&'

$ g++-snapshot -v
 ...
gcc version 4.7.0 20120128 (experimental) [trunk revision 183664] (Debian
20120128-1)

I noticed a similar problem when using copy-initialization on a const object of
a class that is movable (with move constructor accepting T&&, not T const&&)
but not copyable. I noticed that in C++11 8.5 Initializers [dcl.init] takes
great care to specify:

> [...] if the function is a constructor, the call initializes a temporary of 
> the cv-unqualified version of the destination type.

on paragraph 16 (I'm using n3290). I'm not as familiar with C++03 but
apparently the text only mentions creation of a temporary, without exactly
specifying of which type.


[Bug c++/41518] copy initialization of volatile objects

2011-12-09 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41518

Richard Guenther  changed:

   What|Removed |Added

   Keywords||rejects-valid
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2011-12-09
 Ever Confirmed|0   |1
  Known to fail||4.7.0

--- Comment #2 from Richard Guenther  2011-12-09 
09:08:05 UTC ---
EDG also accepts this, 4.7.0 still fails to accept it.

Confirmed.


[Bug c++/41518] copy initialization of volatile objects

2011-12-08 Thread gseanmcg at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41518

Sean McGovern  changed:

   What|Removed |Added

 CC||gseanmcg at gmail dot com

--- Comment #1 from Sean McGovern  2011-12-08 
18:59:04 UTC ---
GCC 4.3 has been unsupported for some time.

Go ahead and close this bug.

If this issue can be reproduced with a supported version of GCC, please re-open
it.