diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-02-22 02:04:18 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-02-22 02:04:18 +0000 |
commit | fd555f6b1fd950eff620e74da887dc37d919a276 (patch) | |
tree | 3c3ce70944db709410b9c1753550d399b57aae6c /clang/test/SemaCXX/overload-call.cpp | |
parent | 3715c691b3f4e88d05ae92d7b831cfceb5865285 (diff) | |
download | bcm5719-llvm-fd555f6b1fd950eff620e74da887dc37d919a276.tar.gz bcm5719-llvm-fd555f6b1fd950eff620e74da887dc37d919a276.zip |
Implement C++11 [expr.call]p11: If the operand to a decltype-specifier is a
function call (or a comma expression with a function call on its right-hand
side), possibly parenthesized, then the return type is not required to be
complete and a temporary is not bound. Other subexpressions inside a decltype
expression do not get this treatment.
This is implemented by deferring the relevant checks for all calls immediately
within a decltype expression, then, when the expression is fully-parsed,
checking the relevant constraints and stripping off any top-level temporary
binding.
Deferring the completion of the return type exposed a bug in overload
resolution where completion of the argument types was not attempted, which
is also fixed by this change.
llvm-svn: 151117
Diffstat (limited to 'clang/test/SemaCXX/overload-call.cpp')
-rw-r--r-- | clang/test/SemaCXX/overload-call.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/overload-call.cpp b/clang/test/SemaCXX/overload-call.cpp index 1bbe00fcd40..501e2d6fb2f 100644 --- a/clang/test/SemaCXX/overload-call.cpp +++ b/clang/test/SemaCXX/overload-call.cpp @@ -534,3 +534,12 @@ namespace rdar9803316 { int &ir = (&foo)(0); } } + +namespace IncompleteArg { + // Ensure that overload resolution attempts to complete argument types. + template<typename T> struct S { + friend int f(const S&); + }; + extern S<int> s; + int k = f(s); +} |