kan-izh / googlemock

Automatically exported from code.google.com/p/googlemock
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

ICC compilation error ::std::tr1::tuple<> #146

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Added gmock to tst file.
2. Compile using ICC.

What is the expected output? What do you see instead?

I am expecting a compile from: 

icc  -ansi -w1 -O2 -std=c++0x -I/usr/include/boost -DGTEST_HAS_TR1_TUPLE=0 
-DGMOCK_HAS_TR1_TUPLE=0    -c -o main.o main.cc
icc  -ansi -w1 -O2 -std=c++0x -I/usr/include/boost -DGTEST_HAS_TR1_TUPLE=0 
-DGMOCK_HAS_TR1_TUPLE=0    -c -o test_YYY.o test_YYY.cc
/usr/include/gmock/internal/gmock-generated-internal-utils.h(70): error: name 
followed by "::" must be a class or namespace name
  struct MatcherTuple< ::std::tr1::tuple<> > {
                              ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(70): error: 
expected an identifier
  struct MatcherTuple< ::std::tr1::tuple<> > {
                                         ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(70): error: 
expected an identifier
  struct MatcherTuple< ::std::tr1::tuple<> > {
                                           ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(75): error: name 
followed by "::" must be a class or namespace name
  struct MatcherTuple< ::std::tr1::tuple<A1> > {
                              ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(75): error: 
expected an identifier
  struct MatcherTuple< ::std::tr1::tuple<A1> > {
                                             ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(80): error: name 
followed by "::" must be a class or namespace name
  struct MatcherTuple< ::std::tr1::tuple<A1, A2> > {
                              ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(80): error: too 
many arguments for class template "testing::internal::MatcherTuple"
  struct MatcherTuple< ::std::tr1::tuple<A1, A2> > {
                                           ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(85): error: name 
followed by "::" must be a class or namespace name
  struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3> > {
                              ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(85): error: too 
many arguments for class template "testing::internal::MatcherTuple"
  struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3> > {
                                           ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(90): error: name 
followed by "::" must be a class or namespace name
  struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4> > {
                              ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(90): error: too 
many arguments for class template "testing::internal::MatcherTuple"
  struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4> > {
                                           ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(96): error: name 
followed by "::" must be a class or namespace name
  struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5> > {
                              ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(96): error: too 
many arguments for class template "testing::internal::MatcherTuple"
  struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5> > {
                                           ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(103): error: name 
followed by "::" must be a class or namespace name
  struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6> > {
                              ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(103): error: too 
many arguments for class template "testing::internal::MatcherTuple"
  struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6> > {
                                           ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(110): error: name 
followed by "::" must be a class or namespace name
  struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7> > {
                              ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(110): error: too 
many arguments for class template "testing::internal::MatcherTuple"
  struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7> > {
                                           ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(117): error: name 
followed by "::" must be a class or namespace name
  struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
                              ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(117): error: too 
many arguments for class template "testing::internal::MatcherTuple"
  struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
                                           ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(124): error: name 
followed by "::" must be a class or namespace name
  struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
                              ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(124): error: too 
many arguments for class template "testing::internal::MatcherTuple"
  struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
                                           ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(131): error: name 
followed by "::" must be a class or namespace name
  struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
                              ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(131): error: too 
many arguments for class template "testing::internal::MatcherTuple"
  struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
                                           ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(157): error: name 
followed by "::" must be a class or namespace name
    typedef ::std::tr1::tuple<> ArgumentTuple;
                   ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(157): error: 
expected an identifier
    typedef ::std::tr1::tuple<> ArgumentTuple;
                              ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(157): error: 
expected a ";"
    typedef ::std::tr1::tuple<> ArgumentTuple;
                              ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(158): error: 
identifier "ArgumentTuple" is undefined
    typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
                                  ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(158): error: 
incomplete type is not allowed
    typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
                     ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(167): error: name 
followed by "::" must be a class or namespace name
    typedef ::std::tr1::tuple<A1> ArgumentTuple;
                   ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(167): error: 
expected a ";"
    typedef ::std::tr1::tuple<A1> ArgumentTuple;
                                ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(168): error: 
identifier "ArgumentTuple" is undefined
    typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
                                  ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(168): error: 
incomplete type is not allowed
    typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
                     ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(177): error: name 
followed by "::" must be a class or namespace name
    typedef ::std::tr1::tuple<A1, A2> ArgumentTuple;
                   ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(177): error: 
expected a ";"
    typedef ::std::tr1::tuple<A1, A2> ArgumentTuple;
                                    ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(178): error: 
identifier "ArgumentTuple" is undefined
    typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
                                  ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(178): error: 
incomplete type is not allowed
    typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
                     ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(187): error: name 
followed by "::" must be a class or namespace name
    typedef ::std::tr1::tuple<A1, A2, A3> ArgumentTuple;
                   ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(187): error: 
expected a ";"
    typedef ::std::tr1::tuple<A1, A2, A3> ArgumentTuple;
                                        ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(188): error: 
identifier "ArgumentTuple" is undefined
    typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
                                  ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(188): error: 
incomplete type is not allowed
    typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
                     ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(197): error: name 
followed by "::" must be a class or namespace name
    typedef ::std::tr1::tuple<A1, A2, A3, A4> ArgumentTuple;
                   ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(197): error: 
expected a ";"
    typedef ::std::tr1::tuple<A1, A2, A3, A4> ArgumentTuple;
                                            ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(198): error: 
identifier "ArgumentTuple" is undefined
    typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
                                  ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(198): error: 
incomplete type is not allowed
    typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
                     ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(208): error: name 
followed by "::" must be a class or namespace name
    typedef ::std::tr1::tuple<A1, A2, A3, A4, A5> ArgumentTuple;
                   ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(208): error: 
expected a ";"
    typedef ::std::tr1::tuple<A1, A2, A3, A4, A5> ArgumentTuple;
                                                ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(209): error: 
identifier "ArgumentTuple" is undefined
    typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
                                  ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(209): error: 
incomplete type is not allowed
    typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
                     ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(219): error: name 
followed by "::" must be a class or namespace name
    typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6> ArgumentTuple;
                   ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(219): error: 
expected a ";"
    typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6> ArgumentTuple;
                                                    ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(220): error: 
identifier "ArgumentTuple" is undefined
    typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
                                  ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(220): error: 
incomplete type is not allowed
    typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
                     ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(230): error: name 
followed by "::" must be a class or namespace name
    typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7> ArgumentTuple;
                   ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(230): error: 
expected a ";"
    typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7> ArgumentTuple;
                                                        ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(231): error: 
identifier "ArgumentTuple" is undefined
    typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
                                  ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(231): error: 
incomplete type is not allowed
    typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
                     ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(241): error: name 
followed by "::" must be a class or namespace name
    typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8> ArgumentTuple;
                   ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(241): error: 
expected a ";"
    typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8> ArgumentTuple;
                                                            ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(242): error: 
identifier "ArgumentTuple" is undefined
    typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
                                  ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(242): error: 
incomplete type is not allowed
    typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
                     ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(252): error: name 
followed by "::" must be a class or namespace name
    typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> ArgumentTuple;
                   ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(252): error: 
expected a ";"
    typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> ArgumentTuple;
                                                                ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(253): error: 
identifier "ArgumentTuple" is undefined
    typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
                                  ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(253): error: 
incomplete type is not allowed
    typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
                     ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(265): error: name 
followed by "::" must be a class or namespace name
    typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
                   ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(266): error: 
expected a ";"
        A10> ArgumentTuple;
           ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(267): error: 
identifier "ArgumentTuple" is undefined
    typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
                                  ^

/usr/include/gmock/internal/gmock-generated-internal-utils.h(267): error: 
incomplete type is not allowed
    typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
                     ^

/usr/include/gmock/internal/gmock-internal-utils.h(738): error: name followed 
by "::" must be a class or namespace name
  class StlContainerView< ::std::tr1::tuple<ElementPointer, Size> > {
                                 ^

/usr/include/gmock/internal/gmock-internal-utils.h(738): error: too many 
arguments for class template "testing::internal::StlContainerView"
  class StlContainerView< ::std::tr1::tuple<ElementPointer, Size> > {
                                                          ^

/usr/include/gmock/gmock-printers.h(500): error: name followed by "::" must be 
a class or namespace name
  inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
                                   ^

/usr/include/gmock/gmock-printers.h(500): error: expected an identifier
  inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
                                              ^

/usr/include/gmock/gmock-printers.h(500): error: expected a ")"
  inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
                                              ^

/usr/include/gmock/gmock-printers.h(501): error: identifier "t" is undefined
    PrintTupleTo(t, os);
                 ^

/usr/include/gmock/gmock-printers.h(501): error: identifier "os" is undefined
    PrintTupleTo(t, os);
                    ^

/usr/include/gmock/gmock-printers.h(505): error: name followed by "::" must be 
a class or namespace name
  void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
                            ^

/usr/include/gmock/gmock-printers.h(505): error: expected a ")"
  void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
                                         ^

/usr/include/gmock/gmock-printers.h(510): error: name followed by "::" must be 
a class or namespace name
  void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
                            ^

/usr/include/gmock/gmock-printers.h(510): error: expected a ")"
  void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
                                             ^

/usr/include/gmock/gmock-printers.h(515): error: name followed by "::" must be 
a class or namespace name
  void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
                            ^

/usr/include/gmock/gmock-printers.h(515): error: expected a ")"
  void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
                                                 ^

/usr/include/gmock/gmock-printers.h(520): error: name followed by "::" must be 
a class or namespace name
  void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
                            ^

/usr/include/gmock/gmock-printers.h(520): error: expected a ")"
  void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
                                                     ^

/usr/include/gmock/gmock-printers.h(525): error: name followed by "::" must be 
a class or namespace name
  void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
                            ^

/usr/include/gmock/gmock-printers.h(525): error: expected a ")"
  void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
                                                         ^

/usr/include/gmock/gmock-printers.h(532): error: name followed by "::" must be 
a class or namespace name
  void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
                            ^

/usr/include/gmock/gmock-printers.h(532): error: expected a ")"
  void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
                                                             ^

/usr/include/gmock/gmock-printers.h(539): error: name followed by "::" must be 
a class or namespace name
  void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
                            ^

/usr/include/gmock/gmock-printers.h(539): error: expected a ")"
  void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
                                                                 ^

/usr/include/gmock/gmock-printers.h(546): error: name followed by "::" must be 
a class or namespace name
  void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
                            ^

/usr/include/gmock/gmock-printers.h(546): error: expected a ")"
  void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
                                                                     ^

/usr/include/gmock/gmock-printers.h(553): error: name followed by "::" must be 
a class or namespace name
  void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
                            ^

/usr/include/gmock/gmock-printers.h(553): error: expected a ")"
  void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
                                                                         ^

/usr/include/gmock/gmock-printers.h(561): error: name followed by "::" must be 
a class or namespace name
      const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
                   ^

/usr/include/gmock/gmock-printers.h(561): error: expected a ")"
      const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
                                                                     ^

/usr/include/gmock/gmock-generated-actions.h(54): error: name followed by "::" 
must be a class or namespace name
  class InvokeHelper<R, ::std::tr1::tuple<> > {
                               ^

/usr/include/gmock/gmock-generated-actions.h(54): error: expected an identifier
  class InvokeHelper<R, ::std::tr1::tuple<> > {
                                          ^

/usr/include/gmock/gmock-generated-actions.h(54): error: expected an identifier
  class InvokeHelper<R, ::std::tr1::tuple<> > {
                                            ^

/usr/include/gmock/gmock-generated-actions.h(70): error: name followed by "::" 
must be a class or namespace name
  class InvokeHelper<R, ::std::tr1::tuple<A1> > {
                               ^

/usr/include/gmock/gmock-generated-actions.h(70): error: expected an identifier
  class InvokeHelper<R, ::std::tr1::tuple<A1> > {
                                              ^

compilation aborted for test_YYY.cc (code 4)
make: *** [test_YYY.o] Error 4

Which version of Google Mock are you using? On what operating system?

Ubuntu version: google-mock_1.4.0-3_amd64.deb

$ icc --version
icc (ICC) 12.0.3 20110309
Copyright (C) 1985-2011 Intel Corporation.  All rights reserved.

$ uname -a
Linux nightwatch 2.6.38-11-generic #48-Ubuntu SMP Fri Jul 29 19:02:55 UTC 2011 
x86_64 x86_64 x86_64 GNU/Linux

Please provide any additional information below.

I am happy to test patched. 

Original issue reported on code.google.com by Sardathr...@gmail.com on 23 Sep 2011 at 3:45

GoogleCodeExporter commented 9 years ago
Does the standard library coming with ICC provide the tuple header? If not, 
build with -DGTEST_USE_OWN_TR1_TUPLE=1. Building with -DGTEST_HAS_TR1_TUPLE=0 
will not get you much as Google Mock _requires_ a tuple.

Original comment by vladlosev on 29 Sep 2011 at 9:16

GoogleCodeExporter commented 9 years ago
That (aka -DGTEST_USE_OWN_TR1_TUPLE=1) has fixed this problem. 

Original comment by Sardathr...@gmail.com on 30 Sep 2011 at 8:17

GoogleCodeExporter commented 9 years ago

Original comment by vladlosev on 1 Oct 2011 at 4:42