public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/43913]  New: error: ‘<expression error>’ is not a valid template argument for type ‘int’ because it is a non-constant expression
@ 2010-04-27 20:46 manu at gcc dot gnu dot org
  0 siblings, 0 replies; only message in thread
From: manu at gcc dot gnu dot org @ 2010-04-27 20:46 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1495 bytes --]

/home/manuel/src/test/gcc/testsuite/g++.dg/template/recurse3.C: In
instantiation of ‘const int Y<1000>::value’:
/home/manuel/src/test/gcc/testsuite/g++.dg/template/recurse3.C:17:17:  
instantiated from here
/home/manuel/src/test/gcc/testsuite/g++.dg/template/recurse3.C:13:46: error:
‘<expression error>’ is not a valid template argument for type ‘int’ because it
is a non-constant expression

Testcase is related to PR9335.

// PR c++/9335
// We should not see an error about non-constant initialization.
// { dg-do compile }
// { dg-options "-ftemplate-depth-15" }
template<int N> struct Y;
template <int N> struct X {
  static const int value = X<Y<N-1>::value>::value;
  // { dg-message "skipping \d instantiation contexts" "" { target *-*-* } 0 }
  // { dg-bogus "expression error" "" { xfail *-*-* } 0 }
};

template <int N> struct Y {
  static const int value = Y<X<N-1>::value>::value;  // { dg-error "incomplete
type" }

};

template struct Y<1000>;


-- 
           Summary: error: ‘<expression error>’ is not a valid template
                    argument for type ‘int’ because it is a non-constant
                    expression
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: manu at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43913


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-04-27 20:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-27 20:46 [Bug c++/43913] New: error: ‘<expression error>’ is not a valid template argument for type ‘int’ because it is a non-constant expression manu at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).