diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice2.C')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice2.C | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice2.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice2.C new file mode 100644 index 000000000..352137aad --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice2.C @@ -0,0 +1,16 @@ +// PR c++/42083 +// { dg-options "-std=c++0x" } + +template<typename F> +decltype(F()) run(F f) // { dg-message "note" } +{ + return f(); +} + +int main() +{ + auto l = []() { return 5; }; + + run(l); // { dg-error "no match" } + // { dg-message "candidate" "candidate note" { target *-*-* } 14 } +} |