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 translation/50533] New: Creating object by calling constructor explicitly


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

             Bug #: 50533
           Summary: Creating object by calling constructor explicitly
    Classification: Unclassified
           Product: gcc
           Version: 4.4.5
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: translation
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: malvikus@gmail.com


Please, look at this debate:
http://stackoverflow.com/questions/7565776/construct-object-by-calling-constructor-method-explicitly.
I'm not expert in C++ and can't say is this bug or not. If it's bug I will add
all needed environments, versions of gcc and so on.

In general:
I can create object by calling constructor explicitly:
throw impress_errors::Error::Error(err_code); - this is compiled and work
correct on version 
g++ (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5 (Ubuntu Maverick - 10.04).
And this code failed on version 
g++ (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2 (Ubuntu Narwhal - 11.04) and 
g++ (Debian 4.6.1-13) 4.6.1 
with following error:
posix_lib.cpp: In function âint pos_close(int)â:
posix_lib.cpp:363:46: error: cannot call constructor
âimpress_errors::Error::Errorâ directly
posix_lib.cpp:363:46: error: for a function-style cast, remove the redundant
â::Errorâ


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