diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-10-05 21:10:08 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-10-05 21:10:08 +0000 |
commit | d3dbbb68b1050da2f58d4bea6b23016f451968c9 (patch) | |
tree | 501a50c56f541590de1a33bb4631671d4e3c85c6 /test/SemaCXX/decl-expr-ambiguity.cpp | |
parent | 86f77d42d090186ad13ee0f239624dc1f93dcdf8 (diff) |
Add some text from the C++ standard and additional ambiguity resolution tests.
No funcitonality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57136 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/decl-expr-ambiguity.cpp')
-rw-r--r-- | test/SemaCXX/decl-expr-ambiguity.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/test/SemaCXX/decl-expr-ambiguity.cpp b/test/SemaCXX/decl-expr-ambiguity.cpp index 35805abac5..3459d771ab 100644 --- a/test/SemaCXX/decl-expr-ambiguity.cpp +++ b/test/SemaCXX/decl-expr-ambiguity.cpp @@ -1,4 +1,4 @@ -// RUN: clang -fsyntax-only -verify %s +// RUN: clang -fsyntax-only -verify -pedantic-errors %s void f() { int a; @@ -14,7 +14,12 @@ void f() { if (int(a)+1) {} for (int(a)+1;;) {} a = sizeof(int()+1); + a = sizeof(int(1)); typeof(int()+1) a2; + (int(1)); // expected-warning {{expression result unused}} + + // type-id + (int())1; // expected-error {{used type 'int ()' where arithmetic or pointer type is required}} // Declarations. T(*d)(int(p)); // expected-warning {{statement was disambiguated as declaration}} expected-error {{previous definition is here}} @@ -25,3 +30,13 @@ void f() { if (int(a)=1) {} int(d3(int())); // expected-warning {{statement was disambiguated as declaration}} } + +class C { }; +void fn(int(C)) { } // void fn(int(*fp)(C c)) { } + // not: void fn(int C); +int g(C); + +void foo() { + fn(1); // expected-error {{incompatible integer to pointer conversion passing 'int', expected 'int (*)(class C)'}} + fn(g); // OK +} |