diff options
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 1 | ||||
-rw-r--r-- | clang/test/CodeGenCXX/conversion-function.cpp | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index a92e6d92519..24b07ca3f43 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1634,6 +1634,7 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { return; switch (D->getKind()) { + case Decl::CXXConversion: case Decl::CXXMethod: case Decl::Function: // Skip function templates diff --git a/clang/test/CodeGenCXX/conversion-function.cpp b/clang/test/CodeGenCXX/conversion-function.cpp new file mode 100644 index 00000000000..57e5ad73151 --- /dev/null +++ b/clang/test/CodeGenCXX/conversion-function.cpp @@ -0,0 +1,9 @@ +// RUN: clang-cc %s -emit-llvm -o %t && +struct S { + operator int(); +}; + +// RUN: grep "_ZN1ScviEv" %t +S::operator int() { + return 10; +} |