This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/26024] Initializing using methods of class object passed to constructor



------- Comment #2 from rguenth at gcc dot gnu dot org  2006-01-30 10:29 -------
D       d(Initializer());

parses as a function declaration, as you see from the error (which is on
the cout line btw.):

//      bug.cpp: In function `int main()':
//      bug.cpp:35: error: request for member `i_' in `d', which is of
non-class type `D
//      ()(Initializer (*)())'

use

D      d((Initializer()));


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26024


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]