Bug 49837 - File with UTF-8 BOM, included from pch, caused compilation error
Summary: File with UTF-8 BOM, included from pch, caused compilation error
Status: RESOLVED DUPLICATE of bug 56549
Alias: None
Product: gcc
Classification: Unclassified
Component: pch (show other bugs)
Version: 4.4.5
: P3 major
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-25 10:22 UTC by Danil Ilinykh
Modified: 2013-09-25 05:22 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Header file with bom (86 bytes, text/x-chdr)
2011-07-25 10:22 UTC, Danil Ilinykh
Details
Main file (44 bytes, text/x-c++src)
2011-07-25 10:23 UTC, Danil Ilinykh
Details
Precompiled header (23 bytes, text/x-chdr)
2011-07-25 10:23 UTC, Danil Ilinykh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Danil Ilinykh 2011-07-25 10:22:59 UTC
Created attachment 24823 [details]
Header file with bom

gcc -v:
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.4.4-14ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5)

Failed attempt:
g++ -x c++-header -c stable.h -o stable.gch/c++
g++ -include ./stable 1.cpp

Output:
In file included from stable.h:1,
                 from 1.cpp:1:
1.h:4: error: redefinition of ‘template<class A, class B> B convert(A)’
1.h:4: error: ‘template<class A, class B> B convert(A)’ previously declared here

Successful:
g++ 1.cpp

Empty output.
Comment 1 Danil Ilinykh 2011-07-25 10:23:30 UTC
Created attachment 24824 [details]
Main file
Comment 2 Danil Ilinykh 2011-07-25 10:23:51 UTC
Created attachment 24825 [details]
Precompiled header
Comment 3 Danil Ilinykh 2013-09-25 05:22:14 UTC
Bug 56549 has better description of the error.

*** This bug has been marked as a duplicate of bug 56549 ***