Skip to content

Fix #50: Remove second and invalid ampersand for an l-value ref.#59

Merged
andreasfertig merged 2 commits into
masterfrom
fixIssue50
Jul 29, 2018
Merged

Fix #50: Remove second and invalid ampersand for an l-value ref.#59
andreasfertig merged 2 commits into
masterfrom
fixIssue50

Conversation

@andreasfertig
Copy link
Copy Markdown
Owner

It looks like clang does handle l-value references in the AST dump
wrong. It adds a second ampersand which makes it an r-value reference.
As #50 points out this second ampersand leads to invalid code. The
workaround implemented here does a simple (but expensive) string search
in case of an l-value ref and simply replaces the && with just &.

To fix #50 it is important to start ensuring that template code is valid
and does not change. Hence all compiling code does define
INSIGHTS_USE_TEMPLATE to enable compilation of the transformed template
code.

Andreas Fertig added 2 commits July 29, 2018 17:28
To fix #50 it is important to start ensuring that template code is valid
and does not change. Hence all compiling code does define
INSIGHTS_USE_TEMPLATE to enable compilation of the transformed template
code.
It looks like clang does handle l-value references in the AST dump
wrong. It adds a second ampersand which makes it an r-value reference.
As #50 points out this second ampersand leads to invalid code. The
workaround implemented here does a simple (but expensive) string search
in case of an l-value ref and simply replaces the && with just &.
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 29, 2018

Codecov Report

Merging #59 into master will decrease coverage by 0.03%.
The diff coverage is 94.73%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #59      +/-   ##
==========================================
- Coverage   95.47%   95.44%   -0.04%     
==========================================
  Files          30       30              
  Lines        1946     1953       +7     
==========================================
+ Hits         1858     1864       +6     
- Misses         88       89       +1
Impacted Files Coverage Δ
CodeGenerator.cpp 96.33% <100%> (ø) ⬆️
InsightsHelpers.cpp 96.71% <80%> (-0.42%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6cd9f66...bf0512b. Read the comment docs.

@andreasfertig andreasfertig merged commit 9e9b109 into master Jul 29, 2018
@andreasfertig andreasfertig deleted the fixIssue50 branch July 29, 2018 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reference collapsing works wrong

1 participant