bugfastcgi++ - Bugs: bug #33326, Include of manager.hpp must happen...

 
 
Show feedback again

bug #33326: Include of manager.hpp must happen before include request.hpp to define derived Request class

Submitted by:  Smeesters Olivier <osmeest>
Submitted on:  Tue 17 May 2011 08:24:39 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Ready For Test
Privacy: PublicAssigned to: Eddie Carle <eddic>
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 28 May 2011 04:32:33 PM UTC, comment #1:

I've pushed a fix for this onto the boostIostreams branch

Eddie Carle <eddic>
Project AdministratorIn charge of this item.
Tue 17 May 2011 08:24:39 AM UTC, original submission:

I tried to define my own request class derived from Request<char>.
To do so, I included only <fastcgi++/request.hpp> and the compilation failed with an error saying that in line 250, the Manager<CustomRequest> was trying to access messages from Request<char> which is private.

The message is quite surprising as all the examples provided with the library don't have this problem.

Looking at the Request code, one can see that a friend Manager<T> is declared.

The problem is that if Fastcgipp::Manager<T> has not been declared beforehand, the compiler will think it is an inner class of the Request class.

So there is one workaround:
- include manager.hpp before request.hpp when defining the derived Request class

Possible solutions:
1) forward declare the Manager template in request.hpp before the definition of Request
That's the best solution.
2) use a fully qualified name (::Fastcgipp::Manager<T>) in the friend declaration
But if the manager.hpp is not included before request.hpp, an error message will still be thrown.

Smeesters Olivier <osmeest>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #23414:  request-manager-implicit-dependency-fix.patch added by osmeest (553B - application/octet-stream - Patch file for solution 1)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by eddic (Posted a comment)
  • -unavailable- added by osmeest (Submitted the item)
  • -unavailable- added by osmeest
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 28 May 2011 04:32:33 PM UTCeddicStatusNone=>Ready For Test
      Assigned toNone=>eddic
    Tue 17 May 2011 08:24:39 AM UTCosmeestAttached File-=>Added request-manager-implicit-dependency-fix.patch, #23414
      Carbon-Copy-=>Added osmeest
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup