Bug #836

r7603 GCC compilation issue

Added by Zbigniew Rebacz about 7 years ago. Updated about 7 years ago.

Status:ApprovedStart date:08/25/2014
Priority:UrgentDue date:
Assignee:Zbigniew Rebacz% Done:

0%

Category:IDESpent time:-
Target version:-

Description

Log:

In file included from /home/klugier/upp/uppsrc/ide/Navigator.cpp:1:0:
/home/klugier/upp/uppsrc/ide/ide.h:367:43: error: template argument 2 is invalid
  VectorMap<int, SortedVectorMap<int, int> > linefo;
                                           ^
/home/klugier/upp/uppsrc/ide/Navigator.cpp: In member function ‘void AssistEditor::SyncCursor()’:
/home/klugier/upp/uppsrc/ide/Navigator.cpp:24:18: error: request for member ‘Find’ in ‘((AssistEditor*)this)->AssistEditor::linefo’, which is of non-class type ‘int’
   int q = linefo.Find(GetCppFileIndex(theide->editfile));
                  ^
/home/klugier/upp/uppsrc/ide/Navigator.cpp:28:3: error: reference to ‘SortedVectorMap’ is ambiguous
   SortedVectorMap<int, int>& m = linefo[q];
   ^
In file included from uppsrc/Core/Core.h:290:0,
                 from uppsrc/Esc/Esc.h:4,
                 from uppsrc/ide/Core/Core.h:4,
                 from uppsrc/ide/Common/Common.h:4,
                 from /home/klugier/upp/uppsrc/ide/ide.h:4,
                 from /home/klugier/upp/uppsrc/ide/Navigator.cpp:1:
uppsrc/Core/InVector.h:25:56: note: candidates are: template<class K, class TT, class Less> class Upp::SortedVectorMap
  template <class K, class TT, class Less> friend class SortedVectorMap;
                                                        ^
In file included from uppsrc/Core/Core.h:290:0,
                 from uppsrc/Esc/Esc.h:4,
                 from uppsrc/ide/Core/Core.h:4,
                 from uppsrc/ide/Common/Common.h:4,
                 from /home/klugier/upp/uppsrc/ide/ide.h:4,
                 from /home/klugier/upp/uppsrc/ide/Navigator.cpp:1:
uppsrc/Core/InVector.h:610:7: note:                 template<class K, class T, class Less> class Upp::SortedVectorMap
 class SortedVectorMap : public SortedAMap<K, T, Less, Slaved_InVector__<T> >,
       ^
/home/klugier/upp/uppsrc/ide/Navigator.cpp:28:19: error: expected primary-expression before ‘int’
   SortedVectorMap<int, int>& m = linefo[q];
                   ^
/home/klugier/upp/uppsrc/ide/Navigator.cpp:28:19: error: expected ‘;’ before ‘int’
/home/klugier/upp/uppsrc/ide/Navigator.cpp:29:7: error: ‘m’ was not declared in this scope
   q = m.FindUpperBound(GetLine(GetCursor()) + 1) - 1;
       ^
/home/klugier/upp/uppsrc/ide/Navigator.cpp: In member function ‘void AssistEditor::Scope()’:
/home/klugier/upp/uppsrc/ide/Navigator.cpp:552:9: error: request for member ‘Clear’ in ‘((AssistEditor*)this)->AssistEditor::linefo’, which is of non-class type ‘int’
  linefo.Clear();
         ^
/home/klugier/upp/uppsrc/ide/Navigator.cpp:573:12: error: request for member ‘GetAdd’ in ‘((AssistEditor*)this)->AssistEditor::linefo’, which is of non-class type ‘int’
     linefo.GetAdd(m->linefo[j].file).Add(m->linefo[j].line, litem.GetCount());
            ^
-e => \e[1mCreating archive\e[0m \e[34m_out/ide/Debuggers/GUI.LINUX.MT.POSIX.SSE2/Debuggers.a\e[0m
In file included from /home/klugier/upp/uppsrc/ide/Assist.cpp:1:0:
/home/klugier/upp/uppsrc/ide/ide.h:367:43: error: template argument 2 is invalid
  VectorMap<int, SortedVectorMap<int, int> > linefo;
                                           ^
In file included from /home/klugier/upp/uppsrc/ide/Debug.cpp:1:0:
/home/klugier/upp/uppsrc/ide/ide.h:367:43: error: template argument 2 is invalid
  VectorMap<int, SortedVectorMap<int, int> > linefo;

History

#1 Updated by Miroslav Fidler about 7 years ago

  • Assignee changed from Miroslav Fidler to Zbigniew Rebacz

Weird, it works for me.

What is OS/GCC version?

Does tutorial/Ntl14 compile on your setup?

#2 Updated by Zbigniew Rebacz about 7 years ago

  • Assignee changed from Zbigniew Rebacz to Miroslav Fidler

Still not luck (revision 7621). Log for fresh ide build:

In file included from /home/klugier/upp/uppsrc/ide/Debuggers/Gdb_MI2.cpp:2:0:
uppsrc/ide/ide.h:368:43: error: template argument 2 is invalid
  VectorMap<int, SortedVectorMap<int, int> > linefo;

Compilator/OS:

Compilator: gcc-4.8.real (Ubuntu 4.8.2-19ubuntu1) 4.8.2
Kernel: 3.13.0-35-generic linux
OS: Ubuntu 14.04 

#3 Updated by Zbigniew Rebacz about 7 years ago

Moreover It seems that Oblivion has got compilation issue too, but the reson is different:

uppsrc/ide/Debug.cpp: In member function 'void Ide::ConditionalBreak()':
uppsrc/ide/Debug.cpp:296:53: Error: 'EditPDBExpression' is not declared in this scope
   if(EditPDBExpression("Conditional breakpoint", brk))

Link to topi: http://www.ultimatepp.org/forums/index.php?t=msg&goto=43551&#msg_43551

#4 Updated by Miroslav Fidler about 7 years ago

  • Assignee changed from Miroslav Fidler to Zbigniew Rebacz

Well, Oblivion's issue is fixed, but I am unable to reproduce yours. In fact, I believe that you might have some problem with your local checkout...

I am testing with

gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1

that is perhaps not the issue.

I have asked you to test 'tutorial/Ntl14'. Does it compile for your?

Do you have "InVector.h" in Core?

Mirek

#5 Updated by Zbigniew Rebacz about 7 years ago

  • Assignee changed from Zbigniew Rebacz to Miroslav Fidler

Still not luck on the r7623 with the same error (GCC). Not errors when compiling tutorial/NTL14 and I have "InVector.h" in Core.

But using clang++ 3.4 as compiler TheIDE compiles normally. It seems that it is GCC 4.8.2 related issue.

P.S.
Compiling with clang++ is not fun, because it produces a lot of warnings like this:

/home/klugier/upp/uppsrc/ide/Valgrind.cpp:117:40: warning: '&&' within '||' [-Wlogical-op-parentheses]
                                                                src = src || hasline && hasdir && hasfile;
                                                                          ~~ ~~~~~~~~~~~~~~~~~~^~~~~~~~~~
/home/klugier/upp/uppsrc/ide/Valgrind.cpp:117:40: note: place parentheses around the '&&' expression to silence this warning
                                                                src = src || hasline && hasdir && hasfile;
                                                                                               ^
                                                                             (                           )

#6 Updated by Miroslav Fidler about 7 years ago

  • Status changed from New to Ready for QA
  • Assignee changed from Miroslav Fidler to Zbigniew Rebacz

Compiler bug, but with easy workaround. Please check...

(WRT clang++, just add -Wlogical-op-parentheses to common commandline...)

#7 Updated by Zbigniew Rebacz about 7 years ago

  • Status changed from Ready for QA to Approved

Also available in: Atom PDF