This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 262801 - Errors when parsing conditional expression inside template
Summary: Errors when parsing conditional expression inside template
Status: STARTED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 8.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: petrk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-13 15:16 UTC by petrk
Modified: 2016-07-15 01:48 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description petrk 2016-07-13 15:16:16 UTC
Case 1:

template <bool val>
struct AAA {
    void roo();
};

void foo() {
    AAA< (1 > 5 && 1 > 6) >().roo(); // roo is unresolved
    int x;
}   

Case 2 (C++11):
#include <vector>

int main() {
    // Bug occurs only if uniform initialization syntax is used and second template type has '*'
    std::vector<std::vector<const char*>>{{"one", "two"}, {"three", "four"}}.size(); // size is unresolved
}
Comment 1 petrk 2016-07-14 10:48:05 UTC
Another one test case from bug 140117:    

#include <boost/mpl/if.hpp>

template <typename T>
struct rank {
    static const bool value = false;
};

template <typename T0, typename T1>
struct AAA {
   typedef typename boost::mpl::if_c<
        rank<T0>::value < rank<T1>::value,
        T1, T0>::type type;
};
Comment 2 petrk 2016-07-14 10:48:49 UTC
In the last test case the most outer ::type is unresolved
Comment 3 petrk 2016-07-14 12:35:57 UTC
First two cases fixed in http://hg.netbeans.org/cnd-main/rev/f736a65bacc3

Case 3 requires name lookup in CsmCompletionTokenProcessor
Comment 4 Quality Engineering 2016-07-15 01:48:06 UTC
Integrated into 'main-silver', will be available in build *201607150002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/f736a65bacc3
User: Petr Kudryavtsev <petrk@netbeans.org>
Log: Fixing #262801 - Errors when parsing conditional expression inside template