[LLVMbugs] [Bug 497] NEW: C++ naughtyness?

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Jan 13 18:14:52 PST 2005


http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=497

           Summary: C++ naughtyness?
           Product: libraries
           Version: trunk
          Platform: HP
        OS/Version: HP-UX
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Target-Independent JIT
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: duraid at octopus.com.au


This is part of my HP-UX porting adventure; I'm building LLVM using the (shiny,
new) HP C++ compiler:

aCC: HP aC++/ANSI C B3910B A.06.00

when building lib/VMCore/Pass.cpp I get:

~~~~~~~~~~~~

"PassManagerT.h", line 149: error #3201: typedef "PassClass" may not be used
          in an elaborated type specifier
    friend class PassManagerTraits<UnitType>::PassClass;
                                              ^
          detected during instantiation of class
                    "llvm::PassManagerT<UnitType> [with UnitType=llvm::Module]"
                    at line 755

"PassManagerT.h", line 150: error #3201: typedef "SubPassClass" may not be
          used in an elaborated type specifier
    friend class PassManagerTraits<UnitType>::SubPassClass;  
                                              ^
          detected during instantiation of class
                    "llvm::PassManagerT<UnitType> [with UnitType=llvm::Module]"
                    at line 755

"PassManagerT.h", line 149: error #3201: typedef "PassClass" may not be used
          in an elaborated type specifier
    friend class PassManagerTraits<UnitType>::PassClass;
                                              ^
          detected during instantiation of class "llvm::PassManagerT<UnitType>
                    [with UnitType=llvm::BasicBlock]" at line 769

"PassManagerT.h", line 150: error #3201: typedef "SubPassClass" may not be
          used in an elaborated type specifier
    friend class PassManagerTraits<UnitType>::SubPassClass;  
                                              ^
          detected during instantiation of class "llvm::PassManagerT<UnitType>
                    [with UnitType=llvm::BasicBlock]" at line 769

"PassManagerT.h", line 149: error #3201: typedef "PassClass" may not be used
          in an elaborated type specifier
    friend class PassManagerTraits<UnitType>::PassClass;
                                              ^
          detected during instantiation of class "llvm::PassManagerT<UnitType>
                    [with UnitType=llvm::Function]" at line 804

"PassManagerT.h", line 150: error #3201: typedef "SubPassClass" may not be
          used in an elaborated type specifier
    friend class PassManagerTraits<UnitType>::SubPassClass;  
                                              ^
          detected during instantiation of class "llvm::PassManagerT<UnitType>
                    [with UnitType=llvm::Function]" at line 804

"Pass.cpp", line 196: error #2265-D: function
          "llvm::PassManagerT<UnitType>::addPass(llvm::PassManagerT<UnitType>::
          PassClass *, llvm::AnalysisUsage &) [with UnitType=llvm::Module]" is
          inaccessible
    PM->addPass(this, AU);
        ^

"Pass.cpp", line 267: error #2265-D: function
          "llvm::PassManagerT<UnitType>::addPass(llvm::PassManagerT<UnitType>::
          SubPassClass *, llvm::AnalysisUsage &) [with UnitType=llvm::Module]"
          is inaccessible
    PM->addPass(this, AU);
        ^

"Pass.cpp", line 272: error #2265-D: function
          "llvm::PassManagerT<UnitType>::addPass(llvm::PassManagerT<UnitType>::
          PassClass *, llvm::AnalysisUsage &) [with UnitType=llvm::Function]"
          is inaccessible
    PM->addPass(this, AU);
        ^

"Pass.cpp", line 305: error #2265-D: function
          "llvm::PassManagerT<UnitType>::addPass(llvm::PassManagerT<UnitType>::
          SubPassClass *, llvm::AnalysisUsage &) [with
          UnitType=llvm::Function]" is inaccessible
    PM->addPass(this, AU);
        ^

"Pass.cpp", line 310: error #2265-D: function
          "llvm::PassManagerT<UnitType>::addPass(llvm::PassManagerT<UnitType>::
          PassClass *, llvm::AnalysisUsage &) [with UnitType=llvm::BasicBlock]"
          is inaccessible
    PM->addPass(this, AU);
        ^

11 errors detected in the compilation of "Pass.cpp".
~~~~~~~~~~

It looks like these _may_ be reasonable errors: from the standard:

[ 7.1.5.3.  Elaborated type specifiers ]

2  3.4.4 describes how name lookup proceeds for the identifier in an
   elaborated type specifier.  If the identifier resolves to a class-name
   or enum-name, the elaborated type specifier introduces it into the
   declaration the same way a simple type specifier introduces its type
   name.  If the identifier resolves to a typedef name or template type
   parameter, the elaborated type specifier is ill-formed.  [Note: this
   implies that, within a class template with a template type parameter
   T, the declaration
       friend class T;
   is ill-formed.]  If name lookup does not find a declaration for the
   name, the elaborated type specifier is ill-formed unless it is of the
   simple form class-key identifier in which case the identifier is
   declared as described in 3.3.1.


g++ (Intel C++?) accepts this I presume, so I wonder what's going on. I may be
smoking something :)



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




More information about the llvm-bugs mailing list