]> granicus.if.org Git - clang/commit
Template instantiation for the declarations of member functions within
authorDouglas Gregor <dgregor@apple.com>
Mon, 23 Mar 2009 23:06:20 +0000 (23:06 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 23 Mar 2009 23:06:20 +0000 (23:06 +0000)
commit2dc0e64e57b2a1786fa53a7dbd1d5c8e255eadb0
tree023d0ce37041ae08a0a6e34b55a894acdeb074fe
parent45a3c05640b1b08e7f7f69f633f899fd0e792f3c
Template instantiation for the declarations of member functions within
a class template. At present, we can only instantiation normal
methods, but not constructors, destructors, or conversion operators.

As ever, this contains a bit of refactoring in Sema's type-checking. In
particular:

  - Split ActOnFunctionDeclarator into ActOnFunctionDeclarator
    (handling the declarator itself) and CheckFunctionDeclaration
    (checking for the the function declaration), the latter of which
    is also used by template instantiation.
  - We were performing the adjustment of function parameter types in
    three places; collect those into a single new routine.
  - When the type of a parameter is adjusted, allocate an
    OriginalParmVarDecl to keep track of the type as it was written.
  - Eliminate a redundant check for out-of-line declarations of member
    functions; hide more C++-specific checks on function declarations
    behind if(getLangOptions().CPlusPlus).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67575 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/Sema.h
lib/Sema/SemaDecl.cpp
lib/Sema/SemaTemplateInstantiateDecl.cpp
lib/Sema/SemaType.cpp
test/SemaCXX/nested-name-spec.cpp
test/SemaTemplate/instantiate-method.cpp [new file with mode: 0644]