aboutsummaryrefslogtreecommitdiff
path: root/gcc/d/dmd/traits.d
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/d/dmd/traits.d')
-rw-r--r--gcc/d/dmd/traits.d5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/d/dmd/traits.d b/gcc/d/dmd/traits.d
index be95432..367c56b 100644
--- a/gcc/d/dmd/traits.d
+++ b/gcc/d/dmd/traits.d
@@ -1268,6 +1268,7 @@ Expression semanticTraits(TraitsExp e, Scope* sc)
auto o = (*e.args)[0];
auto po = isParameter(o);
auto s = getDsymbolWithoutExpCtx(o);
+ auto typeOfArg = isType(o);
UserAttributeDeclaration udad = null;
if (po)
{
@@ -1282,6 +1283,10 @@ Expression semanticTraits(TraitsExp e, Scope* sc)
//printf("getAttributes %s, attrs = %p, scope = %p\n", s.toChars(), s.userAttribDecl, s._scope);
udad = s.userAttribDecl;
}
+ else if (typeOfArg)
+ {
+ // If there is a type but no symbol, do nothing rather than erroring.
+ }
else
{
version (none)