diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-02-11 00:19:33 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-02-11 00:19:33 +0000 |
commit | 3a7796bccc3682d1d206d62f367ec409cdfd21f5 (patch) | |
tree | e72469db2dd718c320fbfb8729bfc1e2406644a9 /clang/lib/Sema/SemaOverload.cpp | |
parent | c8dcf4d72bec6eb1b0402941fe4e865eb7c39f83 (diff) | |
download | bcm5719-llvm-3a7796bccc3682d1d206d62f367ec409cdfd21f5.tar.gz bcm5719-llvm-3a7796bccc3682d1d206d62f367ec409cdfd21f5.zip |
Add partial semantic checking of template arguments that are meant for
non-type template parameters of pointer-to-object and
pointer-to-function type. The most fun part of this is the use of
overload resolution to pick a function from the set of overloaded
functions that comes in as a template argument.
Also, fixed two minor bugs in this area:
- We were allowing non-type template parameters of type pointer to
void.
- We weren't patching up an expression that refers to an overloaded
function set via "&f" properly.
We're still not performing complete checking of the expression to be
sure that it is referring to an object or function with external
linkage (C++ [temp.arg.nontype]p1).
llvm-svn: 64266
Diffstat (limited to 'clang/lib/Sema/SemaOverload.cpp')
-rw-r--r-- | clang/lib/Sema/SemaOverload.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index c91b507dc83..64c61e17ad1 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -3953,7 +3953,7 @@ void Sema::FixOverloadedFunctionReference(Expr *E, FunctionDecl *Fn) { assert(UnOp->getOpcode() == UnaryOperator::AddrOf && "Can only take the address of an overloaded function"); FixOverloadedFunctionReference(UnOp->getSubExpr(), Fn); - E->setType(Context.getPointerType(E->getType())); + E->setType(Context.getPointerType(UnOp->getSubExpr()->getType())); } else if (DeclRefExpr *DR = dyn_cast<DeclRefExpr>(E)) { assert(isa<OverloadedFunctionDecl>(DR->getDecl()) && "Expected overloaded function"); |