summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/instantiate-member-class.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-01-13 17:31:36 +0000
committerDouglas Gregor <dgregor@apple.com>2010-01-13 17:31:36 +0000
commit9de54ea41bdcf97f238ba9c4a1fa1d091d5813d9 (patch)
treecba2865d8d63cf45bf9270ea576c1e68bd757a88 /clang/test/SemaTemplate/instantiate-member-class.cpp
parentb89b99f1f267237d68712b728b4aa5c90907cb48 (diff)
downloadbcm5719-llvm-9de54ea41bdcf97f238ba9c4a1fa1d091d5813d9.tar.gz
bcm5719-llvm-9de54ea41bdcf97f238ba9c4a1fa1d091d5813d9.zip
Reimplement constructor declarator parsing to cope with template-ids
that name constructors, the endless joys of out-of-line constructor definitions, and various other corner cases that the previous hack never imagined. Fixes PR5688 and tightens up semantic analysis for constructor names. Additionally, fixed a problem where we wouldn't properly enter the declarator scope of a parenthesized declarator. We were entering the scope, then leaving it when we saw the ")"; now, we re-enter the declarator scope before parsing the parameter list. Note that we are forced to perform some tentative parsing within a class (call it C) to tell the difference between C(int); // constructor and C (f)(int); // member function which is rather unfortunate. And, although it isn't necessary for correctness, we use the same tentative-parsing mechanism for out-of-line constructors to improve diagnostics in icky cases like: C::C C::f(int); // error: C::C refers to the constructor name, but // we complain nicely and recover by treating it as // a type. llvm-svn: 93322
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-member-class.cpp')
-rw-r--r--clang/test/SemaTemplate/instantiate-member-class.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/SemaTemplate/instantiate-member-class.cpp b/clang/test/SemaTemplate/instantiate-member-class.cpp
index 8a19d74cdde..742abcc569c 100644
--- a/clang/test/SemaTemplate/instantiate-member-class.cpp
+++ b/clang/test/SemaTemplate/instantiate-member-class.cpp
@@ -14,8 +14,8 @@ public:
X<int>::C *c1;
X<float>::C *c2;
-X<int>::X *xi;
-X<float>::X *xf;
+X<int>::X *xi; // expected-error{{qualified reference to 'X' is a constructor name rather than a type wherever a constructor can be declared}}
+X<float>::X *xf; // expected-error{{qualified reference to 'X' is a constructor name rather than a type wherever a constructor can be declared}}
void test_naming() {
c1 = c2; // expected-error{{incompatible type assigning 'X<float>::C *', expected 'X<int>::C *'}}
OpenPOWER on IntegriCloud