]> granicus.if.org Git - clang/commit
When instantiating a function type, instantiate the return type before
authorDouglas Gregor <dgregor@apple.com>
Tue, 31 Aug 2010 00:26:14 +0000 (00:26 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 31 Aug 2010 00:26:14 +0000 (00:26 +0000)
commit7e010a04fef171049291d8cb3047f118566da090
tree0e421e1c64244608f1120b73d9de4a1e3460b2dc
parent04633eb86621747bece5643f5909222e2dd6884f
When instantiating a function type, instantiate the return type before
instantiating the parameters. In a perfect world, this wouldn't
matter, and compilers are free to instantiate in any order they
want. However, every other compiler seems to instantiate the return
type first, and some code (in this case, Boost.Polygon) depends on
this and SFINAE to avoid instantiating something that shouldn't be
instantiated.

We could fight this battle, and insist that Clang is allowed to do
what it does, but it's not beneficial: it's more predictable to
instantiate this way, in source order. When we implement
late-specified return types, we'll need to instantiate the return type
last when it was late-specified, hence the FIXME.

We now compile Boost.Polygon properly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112561 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/TreeTransform.h
test/CXX/temp/temp.fct.spec/temp.deduct/sfinae-1.cpp