Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

[REG 2.063a] Issue 9545 - ICE with member template instantiation #1678

Merged
merged 2 commits into from about 1 year ago

2 participants

Hara Kenji Walter Bright
Walter Bright WalterBright merged commit 4b83c91 into from February 20, 2013
Walter Bright WalterBright closed this February 20, 2013
Deleted user Unknown referenced this pull request from a commit December 24, 2013
Commit has since been removed from the repository and is no longer available.
Deleted user Unknown referenced this pull request from a commit December 25, 2013
Commit has since been removed from the repository and is no longer available.
Deleted user Unknown referenced this pull request from a commit December 25, 2013
Commit has since been removed from the repository and is no longer available.
Deleted user Unknown referenced this pull request from a commit December 25, 2013
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
4  src/expression.c
@@ -7097,7 +7097,7 @@ Expression *DotVarExp::semantic(Scope *sc)
7097 7097
             if (e)
7098 7098
                 return e;
7099 7099
 
7100  
-            if (v->isDataseg())     // fix bugzilla 8238
  7100
+            if (v && v->isDataseg())     // fix bugzilla 8238
7101 7101
             {
7102 7102
                 // (e1, v)
7103 7103
                 accessCheck(loc, sc, e1, v);
@@ -7321,7 +7321,7 @@ Expression *DotTemplateInstanceExp::semantic(Scope *sc, int flag)
7321 7321
             return new ErrorExp();
7322 7322
         Dsymbol *s = ti->inst->toAlias();
7323 7323
         Declaration *v = s->isDeclaration();
7324  
-        if (v)
  7324
+        if (v && (v->isFuncDeclaration() || v->isVarDeclaration()))
7325 7325
         {
7326 7326
             /* Fix for Bugzilla 4003
7327 7327
              * The problem is a class template member function v returning a reference to the same
14  test/fail_compilation/ice9545.d
... ...
@@ -0,0 +1,14 @@
  1
+// REQUIRED_ARGS: -o-
  2
+/*
  3
+TEST_OUTPUT:
  4
+----
  5
+fail_compilation/ice9545.d(13): Error: expression has no value
  6
+----
  7
+*/
  8
+
  9
+struct S { template T(X) { alias T = X; } }
  10
+
  11
+void main()
  12
+{
  13
+    auto x1 = S.init.T!int; // ICE
  14
+}
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.