diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 4 | ||||
-rw-r--r-- | cpp/test/Slice/structure/.gitignore | 3 | ||||
-rw-r--r-- | cpp/test/Slice/structure/Forward.ice | 27 | ||||
-rw-r--r-- | cpp/test/Slice/structure/Makefile | 5 | ||||
-rw-r--r-- | cpp/test/Slice/structure/Makefile.mak | 3 |
5 files changed, 39 insertions, 3 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 6085dc7bc2c..d1effc81427 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -385,6 +385,10 @@ Slice::Gen::generate(const UnitPtr& p) H << "\n#include <Ice/Proxy.h>"; H << "\n#include <Ice/OutgoingAsync.h>"; } + else if(p->hasNonLocalClassDecls()) + { + H << "\n#include <Ice/Proxy.h>"; + } if(p->hasNonLocalDataOnlyClasses() || p->hasNonLocalExceptions()) { diff --git a/cpp/test/Slice/structure/.gitignore b/cpp/test/Slice/structure/.gitignore index 505a9066685..62f70721235 100644 --- a/cpp/test/Slice/structure/.gitignore +++ b/cpp/test/Slice/structure/.gitignore @@ -2,5 +2,8 @@ // IMPORTANT: Do not edit this file -- any edits made here will be lost! client +Forward.cpp +Forward.h Test.cpp Test.h + diff --git a/cpp/test/Slice/structure/Forward.ice b/cpp/test/Slice/structure/Forward.ice new file mode 100644 index 00000000000..8573fe67ba7 --- /dev/null +++ b/cpp/test/Slice/structure/Forward.ice @@ -0,0 +1,27 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + + +// +// Ensure that a struct that use a fordward declared proxy +// compiles event if the Slice file does not contains classes +// or interface definitions. +// +module Test +{ + +interface Forward; + +struct Init +{ + Forward* member; + int x = 0; +}; + +}; diff --git a/cpp/test/Slice/structure/Makefile b/cpp/test/Slice/structure/Makefile index 801d42af1a9..76cda413a2c 100644 --- a/cpp/test/Slice/structure/Makefile +++ b/cpp/test/Slice/structure/Makefile @@ -14,11 +14,12 @@ CLIENT = $(call mktestname,client) TARGETS = $(CLIENT) COBJS = Client.o \ - Test.o + Test.o \ + Forward.o SRCS = $(COBJS:.o=.cpp) -SLICE_SRCS = Test.ice +SLICE_SRCS = Test.ice Forward.ice include $(top_srcdir)/config/Make.rules diff --git a/cpp/test/Slice/structure/Makefile.mak b/cpp/test/Slice/structure/Makefile.mak index 567cecf7878..396a803f943 100644 --- a/cpp/test/Slice/structure/Makefile.mak +++ b/cpp/test/Slice/structure/Makefile.mak @@ -14,7 +14,8 @@ CLIENT = client.exe TARGETS = $(CLIENT) COBJS = Test.obj \ - Client.obj + Client.obj \ + Forward.obj SRCS = $(COBJS:.obj=.cpp) |