http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55694



             Bug #: 55694

           Summary: LD error if  0 is added to int variable.

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: c++

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: leo...@volnitsky.com





Not sure if this is a bug.  It have same behavior with gcc-4.7.2, 

gcc-4.8.0-20121208 and clang-3.2.



I was not able to reproduce this error in minimal example. 

Attached two files: ld-error.ii and no-error.ii.



----------------------------------------------

diff *.ii



97125c97125

< out(), is_callable<int(int),int(int)>::value;

---

> out(), 0+is_callable<int(int),int(int)>::value;

----------------------------------------------



So after adding 0 to integer expression there is no error. 

This is heavy mataprogramming code. 

is_callable  - metafunction

comma - is overloaded

out() - some temporary object



Error message:



-----------------------------------------------

g++-4.8.0-pre9999: warning: -pipe ignored because -save-temps specified

main.o: In function `main':

/tmp/scc-lvv-pts1/snippet.cc:2: undefined reference to `sto::is_callable<int

(int), int (int)>::value'

collect2: error: ld returned 1 exit status

-----------------------------------------------

Reply via email to