Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Unified Diff: gcc/gcc/testsuite/g++.dg/tc1/dr147.C

Issue 3050029: [gcc] GCC 4.5.0=>4.5.1 (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/nacl-toolchain.git
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gcc/gcc/testsuite/g++.dg/parse/typespec1.C ('k') | gcc/gcc/testsuite/g++.dg/template/crash37.C » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcc/gcc/testsuite/g++.dg/tc1/dr147.C
diff --git a/gcc/gcc/testsuite/g++.dg/tc1/dr147.C b/gcc/gcc/testsuite/g++.dg/tc1/dr147.C
index 26ac6a60eccc774003011bc2cf995ed563757979..6799b7dccad0c17376e9f2b1ba264ee0d6d3b61a 100644
--- a/gcc/gcc/testsuite/g++.dg/tc1/dr147.C
+++ b/gcc/gcc/testsuite/g++.dg/tc1/dr147.C
@@ -4,15 +4,24 @@
namespace N1 {
-struct A { A(); };
+struct A { A(); void f(); };
struct B: public A { B(); };
A::A() { }
B::B() { }
B::A ba;
-A::A a; // { dg-error "" "the injected-class-name can never be found through qualified lookup" { xfail *-*-* } }
+A::A a; // { dg-error "constructor" "the injected-class-name can never be found through qualified lookup" }
+void A::f()
+{
+ A::A(); // { dg-message "::A" "c++/42415" }
+}
+
+void f()
+{
+ A::A a; // { dg-error "constructor" }
+} // { dg-error "" "" { target *-*-* } 23 } error cascade
}
namespace N2 {
@@ -26,6 +35,32 @@ template <class T> struct A {
template <class T2> A(T2);
static A x;
};
-template<> A<int>::A<int>(A<int>::x); // { dg-error "" "this is an invalid declaration of the constructor" { xfail *-*-* } }
+template<> template <> A<char>::A<char>(char);
+template<> A<int>::A<int>(A<int>::x); // { dg-error "" "this is an invalid declaration of the constructor" }
}
+
+// But DR 318 says that in situations where a type is syntactically
+// required, lookup finds it.
+
+struct C
+{
+ C();
+ typedef int T;
+};
+struct C::C c;
+C::C::T t;
+struct D: C::C
+{
+ D(): C::C() { }
+};
+
+// And if lookup doesn't find the injected-class-name, we aren't naming the
+// constructor (c++/44401).
+
+struct E
+{
+ int E;
+};
+
+int E::*p = &E::E;
« no previous file with comments | « gcc/gcc/testsuite/g++.dg/parse/typespec1.C ('k') | gcc/gcc/testsuite/g++.dg/template/crash37.C » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698