Comments (8)
Hi Kelly,
I started working on the cppaggregate branch, only showcase.d works for the time being but it should catch up quickly since this simplifies things a great deal (the cost being that we'll get different semantics for D classes and for C++ classes, but no more ambiguities between whether a class is value or reference based on C++ compilation options).
I'll have a look at list.d once I bring back vector, string, bitset, deque and map.
from calypso.
Ok, sounds good Elie.
from calypso.
The bug seems to come from DMD: the deduced type for _Predicate throws away the const qualifier in ยซ bool function(const(int) value) ยป, so the previously matching remove_if instance gets discarded too by TypeFunction::callMatch().
Removing const in single_digit() makes list.d compile and run. I'll track where does const disappear tomorrow.
from calypso.
Okay, it's not DMD but this line in Sema while sending the (correct) template argument to instantiate remove_if<...>:
ArgType = Context.getCanonicalType(ArgType);
Prior to this call:
(gdb) call ArgType.dump()
PointerType 0xc0d86f0 'PointerType FunctionProtoType BuiltinType _Bool (*)(const BuiltinType int)'
`-FunctionProtoType 0xc0d8680 'FunctionProtoType BuiltinType _Bool (const BuiltinType int)' cdecl
|-BuiltinType 0xa33e520 'BuiltinType _Bool'
`-QualType 0xa33e5a1 'const BuiltinType int' const
`-BuiltinType 0xa33e5a0 'BuiltinType int'
Then:
(gdb) call ArgType.dump()
PointerType 0xc0d86c0 'PointerType FunctionProtoType BuiltinType _Bool (*)(BuiltinType int)'
`-FunctionProtoType 0xc0d8640 'FunctionProtoType BuiltinType _Bool (BuiltinType int)' cdecl
|-BuiltinType 0xa33e520 'BuiltinType _Bool'
`-BuiltinType 0xa33e5a0 'BuiltinType int'
Clang bug or expected behavior? If it's a bug it's not causing too much harm in Clang which is probably why it's still here, and if it's expected behavior I can't understand why and accustoming the Calypso side to this strange behavior of getCanonicalType won't be easy. In any case I think we should stick with the workaround for now.
from calypso.
It's still in latest Clang 3.7 and it looks like stripping the parameters from qualifiers in canonical function type is sought after..:
http://clang.llvm.org/doxygen/classclang_1_1ASTContext.html#aebe1c0862e34693bddd4683b51558e35 (ASTContext::getCanonicalParamType)
from calypso.
Looks like just using the workaround is the way to go. I tried compiling the cppaggregate branch to test this and I ran into an error in mtype.c...I suppose you must have this fixed on your end??
diff --git a/dmd2/mtype.c b/dmd2/mtype.c
index 19fcc2b..d87862b 100644
--- a/dmd2/mtype.c
+++ b/dmd2/mtype.c
@@ -9797,7 +9797,7 @@ AggregateDeclaration *getAggregateSym(Type *t)
TypeClass *isClassValue(Type *t)
{
- if (t->ty != Tclass) return false;
- if (t->ty != Tclass) return NULL;
TypeClass* tc = (TypeClass*)t;
return tc->byRef() ? NULL : tc;
}
Anyways, it looks like things are back to about the same, for libstdc++ tests, as they were a couple weeks ago. I'll see if I can get around to testing some other libs. I can see a few errors in my qt5demo extended version, so some rewriting will be needed.
Is there anything else left to do on this branch or is it going to merge with master right away?
from calypso.
Good catch, and no it's just that my compiler is a cool dude :)
On to the Qt5 demo, and then it'll be on par with master so ready to merge.
from calypso.
This was definitely fixed with the switch from DMD's to Clang's template argument deduction.
from calypso.
Related Issues (20)
- Major blocker: DMD bogus forward and circular reference errors. HOT 1
- Rebase for LLVM 6 support HOT 3
- Please define project status HOT 3
- Linking to opencv issue.
- Windows binaries HOT 2
- Error building clang-7 branch
- Would this work with binderoo?
- Is there a Calypso forum or chatroom?
- Using-declaration in C++ not understood by Calypso HOT 2
- Global operators not working HOT 2
- ICE on string assignment to QSharedMemory HOT 1
- Cannot use D struct/class in QList HOT 3
- Cannot assign to QJsonObject HOT 1
- Cannot compare QStrings for equality HOT 2
- Linking Calypso fails HOT 2
- foreach over C++ iterator HOT 1
- Assertion `int_regs + sse_regs <= 2' failed HOT 1
- Header included multiple times with pragma once HOT 1
- Document compilation from scratch HOT 1
- Running `basics` test fails with "Global is external, but doesn't have external or weak linkage!" and "Alias must point to a definition"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from calypso.