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: unassig...@gcc.gnu.org
        ReportedBy: malvi...@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’

Reply via email to