[LLVMbugs] [Bug 9894] New: "error: use of undeclared identifier" on valid template code

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue May 10 16:50:15 PDT 2011


           Summary: "error: use of undeclared identifier" on valid
                    template code
           Product: clang
           Version: 2.9
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: alonzakai at gmail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

template<class MDL> struct modelcommands
  template<class F> void modelcommand(F *fun) {}
  static void setdir(char *name) {}
  modelcommands() { modelcommand(setdir); }

template<class MDL> struct vertcommands : modelcommands<MDL>
  static void loadpart(char *model) {}
  vertcommands() { modelcommand(loadpart); }

int main()
  return 1;

The above code compiles ok in gcc but fails in clang, with 

llvm1.cpp:11:20: error: use of undeclared identifier 'modelcommand'
  vertcommands() { modelcommand(loadpart); }
1 error generated.

(The code is a reduced case from Sauerbraten, an open source FPS I am trying to
compile with clang.)

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list