diff options
| author | Richard Trieu <rtrieu@google.com> | 2012-10-01 17:39:51 +0000 |
|---|---|---|
| committer | Richard Trieu <rtrieu@google.com> | 2012-10-01 17:39:51 +0000 |
| commit | 3267347ccac4009d14a2be63bde5cc471de244bf (patch) | |
| tree | d954a2bc10b6f7b407be555febf70b71630c6ee0 /clang/test/Parser | |
| parent | e00af8093c2fc454dc3d2f1987e16c5fc64ed8e8 (diff) | |
| download | bcm5719-llvm-3267347ccac4009d14a2be63bde5cc471de244bf.tar.gz bcm5719-llvm-3267347ccac4009d14a2be63bde5cc471de244bf.zip | |
Cleaning up the self initialization checker.
-Allow Sema to do more processing on the initial Expr before checking it.
-Remove the special conditions in HandleExpr()
-Move the code so that only one call site is needed.
-Removed the function from Sema and only call it locally.
-Warn on potentially evaluated reference variables, not just casts to r-values.
-Update tests.
llvm-svn: 164951
Diffstat (limited to 'clang/test/Parser')
| -rw-r--r-- | clang/test/Parser/cxx0x-condition.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/test/Parser/cxx0x-condition.cpp b/clang/test/Parser/cxx0x-condition.cpp index e45cd866ff2..8b64bcf1273 100644 --- a/clang/test/Parser/cxx0x-condition.cpp +++ b/clang/test/Parser/cxx0x-condition.cpp @@ -27,10 +27,11 @@ void f() { if (S b(n) = 0) {} // expected-error {{a function type is not allowed here}} if (S b(n) == 0) {} // expected-error {{a function type is not allowed here}} expected-error {{did you mean '='?}} - if (S{a}) {} // ok - if (S a{a}) {} // ok - if (S a = {a}) {} // ok - if (S a == {a}) {} // expected-error {{did you mean '='?}} + S s(a); + if (S{s}) {} // ok + if (S a{s}) {} // ok + if (S a = {s}) {} // ok + if (S a == {s}) {} // expected-error {{did you mean '='?}} if (S(b){a}) {} // ok if (S(b) = {a}) {} // ok |

