diff options
| author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-10-17 20:50:27 +0000 |
|---|---|---|
| committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-10-17 20:50:27 +0000 |
| commit | fef1c0d54f1389dec05e0d3fcca5439353da3e07 (patch) | |
| tree | 796716b30ece2403b161ecf69050dcce9aacd2e2 /clang/test/CodeGenCXX/address-of-fntemplate.cpp | |
| parent | 98dd6d292751897108bf62a9da409cdf71815778 (diff) | |
| download | bcm5719-llvm-fef1c0d54f1389dec05e0d3fcca5439353da3e07.tar.gz bcm5719-llvm-fef1c0d54f1389dec05e0d3fcca5439353da3e07.zip | |
Don't add implicit casts of explicit address-taking of overloaded functions.
Taking the address of an overloaded function with an explicit address-of operator wrapped the operator in an implicit cast that added yet another pointer level, leaving us with a corrupted AST, which crashed CodeGen in the test case I've added. Fix this by making FixOverloadedFunctionReference return whether there was an address-of operator and not adding the implicit cast in that case.
llvm-svn: 84362
Diffstat (limited to 'clang/test/CodeGenCXX/address-of-fntemplate.cpp')
| -rw-r--r-- | clang/test/CodeGenCXX/address-of-fntemplate.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/address-of-fntemplate.cpp b/clang/test/CodeGenCXX/address-of-fntemplate.cpp new file mode 100644 index 00000000000..cbf042551de --- /dev/null +++ b/clang/test/CodeGenCXX/address-of-fntemplate.cpp @@ -0,0 +1,9 @@ +// RUN: clang-cc %s -emit-llvm -o - | FileCheck %s +template <typename T> void f(T) {} + +void test() { + // FIXME: This emits only a declaration instead of a definition + // CHECK: @_Z1fIiEvT_ + void (*p)(int) = &f; +} +// CHECK-disabled: define linkonce_odr void @_Z1fIiEvT_ |

