mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-29 18:05:31 +08:00
pt.c (convert_nontype_argument): STRIP_NOPS where appropriate.
Thu Mar 26 10:25:52 1998 Mark Mitchell <mmitchell@usa.net> * pt.c (convert_nontype_argument): STRIP_NOPS where appropriate. From-SVN: r18841
This commit is contained in:
parent
00459c3ad1
commit
49bf0d6f80
@ -1,3 +1,7 @@
|
||||
Thu Mar 26 10:25:52 1998 Mark Mitchell <mmitchell@usa.net>
|
||||
|
||||
* pt.c (convert_nontype_argument): STRIP_NOPS where appropriate.
|
||||
|
||||
Thu Mar 26 10:24:05 1998 Mark Mitchell <mmitchell@usa.net>
|
||||
|
||||
* call.c (build_object_call): Complain about ambiguous operator(),
|
||||
|
@ -1861,8 +1861,10 @@ convert_nontype_argument (type, expr)
|
||||
|| expr_type == unknown_type_node)
|
||||
{
|
||||
tree referent;
|
||||
tree e = expr;
|
||||
STRIP_NOPS (e);
|
||||
|
||||
if (TREE_CODE (expr) != ADDR_EXPR)
|
||||
if (TREE_CODE (e) != ADDR_EXPR)
|
||||
{
|
||||
bad_argument:
|
||||
cp_error ("`%E' is not a valid template argument", expr);
|
||||
@ -1874,7 +1876,7 @@ convert_nontype_argument (type, expr)
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
referent = TREE_OPERAND (expr, 0);
|
||||
referent = TREE_OPERAND (e, 0);
|
||||
STRIP_NOPS (referent);
|
||||
|
||||
if (TREE_CODE (referent) == STRING_CST)
|
||||
|
28
gcc/testsuite/g++.old-deja/g++.pt/nontype3.C
Normal file
28
gcc/testsuite/g++.old-deja/g++.pt/nontype3.C
Normal file
@ -0,0 +1,28 @@
|
||||
// Build don't link:
|
||||
|
||||
enum E { e };
|
||||
|
||||
template <const E* ep>
|
||||
struct S1
|
||||
{
|
||||
static char* s;
|
||||
};
|
||||
|
||||
template <int D>
|
||||
struct S2 {};
|
||||
|
||||
template <>
|
||||
struct S2<1>
|
||||
{
|
||||
static E es[1];
|
||||
};
|
||||
|
||||
struct S3
|
||||
{
|
||||
typedef S1<S2<1>::es> S3_Type;
|
||||
};
|
||||
|
||||
E S2<1>::es[1] = {e};
|
||||
|
||||
template <>
|
||||
char* S1<S2<1>::es>::s = "abc";
|
Loading…
Reference in New Issue
Block a user