#1505 Gcc parser errors obtained from dune code
Metadata
Property | Value |
---|---|
Reported by | Tobias Malkmus (tomalk@mathematik.uni-freiburg.de) |
Reported at | Sep 30, 2014 10:31 |
Type | Bug Report |
Version | 2.3 |
Operating System | Unspecified / All |
Description
Today i figured out that all gcc versions i tested (3.4, 4.1, 4.4, - 4.9) have a template parser bug. I wrote a small test which triggers this bug (test.cc).
If a template function exists with the same name as a member of an object and this member object is compared within an other template function via "<" operator, gcc interprets this as a call to the first template function. Since there is no closing ">" bracket a parser error is thrown.
Why is this important for us? In the last days some free template functions such as entities/elements and further have been added in order to support ranged based for loops over the gridviews. The new template function elements gets into conflict with the member "elements" of IndexedTypeInformation in the dune-common communicator object.
To reproduce this error within dune try to run a headercheck (with MPI! and no debug flags) on the dummy header file which is attached. Two possible patches for the communicator class are attached, too.
I found this bug for gcc but not for clang. Could one of you please test this, either the test.cc or the dune headercheck, with other compilers such as icc? If you can confirm this bug within the gcc i can write a bug report for the gcc list.
Best Tobias