From f25106753029204b2b9b3a523f56b1573d3ea8f6 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 21 Sep 2009 19:57:38 +0000 Subject: Enhance "case" code completion in C++ to suggest qualified names for enumerators when either the user intentionally wrote a qualified name (in which case we just use that nested-name-specifier to match the user's code) or when this is the first "case" statement and we need a qualified name to refer to an enumerator in a different scope. llvm-svn: 82474 --- .../CodeCompletion/enum-switch-case-qualified.cpp | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 clang/test/CodeCompletion/enum-switch-case-qualified.cpp (limited to 'clang/test/CodeCompletion/enum-switch-case-qualified.cpp') diff --git a/clang/test/CodeCompletion/enum-switch-case-qualified.cpp b/clang/test/CodeCompletion/enum-switch-case-qualified.cpp new file mode 100644 index 00000000000..fc1b0ea0757 --- /dev/null +++ b/clang/test/CodeCompletion/enum-switch-case-qualified.cpp @@ -0,0 +1,33 @@ +// RUN: clang-cc -fsyntax-only -code-completion-dump=1 %s -o - | FileCheck -check-prefix=CC1 %s && +// RUN: true + +namespace M { + +namespace N { + struct C { + enum Color { + Red, + Orange, + Yellow, + Green, + Blue, + Indigo, + Violet + }; + }; +} + +} + +namespace M { + +void test(enum N::C::Color color) { + switch (color) { + // CHECK-NEXT-CC1: Blue : 0 : N::C::Blue + // CHECK-NEXT-CC1: Green : 0 : N::C::Green + // CHECK-NEXT-CC1: Indigo : 0 : N::C::Indigo + // CHECK-NEXT-CC1: Orange : 0 : N::C::Orange + // CHECK-NEXT-CC1: Red : 0 : N::C::Red + // CHECK-NEXT-CC1: Violet : 0 : N::C::Violet + // CHECK-NEXT-CC1: Yellow : 0 : N::C::Yellow + case -- cgit v1.2.3